
Rev. 1.00
399 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
19 Inter-Integrated Circuit (I2C)
Master Transmitter Mode
Start Condition
Users write the target slave device address and communication direction into the I2CTAR register
after setting the I2CEN bit in the I2CCR register. The STA flag in the I2CSR register is set by
hardware after a start condition occurs. In order to send the following address frame, the STA flag
must be cleared to 0 if it has been set to 1. The STA flag is cleared by reading the I2CSR register.
Address Frame
The ADRS flag in the I2CSR register will be set after the address frame is sent by the master
device and the acknowledge signal from the address matched slave device is received. In order
to send the following data frame, the ADRS flag must be cleared to 0 if it has been set to 1. The
ADRS bit is cleared by reading the I2CSR register.
Data Frame
The data to be transmitted to the slave device must be transferred to the I2CDR register.
The TXDE bit in the I2CSR register is set to indicate that the I2CDR register is empty, which
results in the SCL line being held at a logic low state. New data must then be transferred to the
I2CDR register to continue the data transfer process. Writing a data into the I2CDR register will
clear the TXDE flag.
Close / Continue Transmission
After transmitting the last data byte, the STOP bit in the I2CCR register can be set to terminate the
transmission or re-assign another slave device by configuring the I2CTAR register to restart a new
transfer.
S
STA
Address
A
ADRS TXDE
Data1
A
TXDE
Data2
A
...
TXDE
DataN
TXDE
P
7-bit Master Transmitter
S
STA
Header
A
Data1
A
TXDE
Data2
A
...
TXDE
DataN
TXDE
P
10-bit Master Transmitter
Address
A
ADRS TXDE
A
A
BEH1
BEH1 BEH2
BEH3
BEH1
BEH1
BEH3
BEH2
BEH2
BEH2
BEH2
BEH2
BEH1 : cleared by reading I2CSR register
BEH2 : cleared by writing I2CDR register
BEH3 : cleared by HW automatically by sending STOP condition
Figure 147. Master Transmitter Timing Diagram