
Rev. 1.00
426 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
20 Inter-Integrated Circuit (I2C)
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 149. Master Transmitter Timing Diagram
Master Receiver Mode
Start Condition
The target slave device address and communication direction must be written into the I2CTAR
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
In the 7-bit addressing mode: The ADRS flag is 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 receive the following data frame, the ADRS bit must be cleared to 0 if it has been set to 1. The
ADRS bit is cleared after reading the I2CSR register.
In the 10-bit addressing mode: The ADRS bit in the I2CSR register will be set twice in the 10-bit
addressing mode. The first time the ADRS bit is set is when the first header byte and the second
address byte are sent and the acknowledge signals from the slave device are received. The second
time the ADRS bit is set is when the second header byte is sent and the slave acknowledge signal
is received. In order to receive the following data frame, the ADRS bit must be cleared to 0 if it
has been set to 1. The ADRS bit is cleared after reading the I2CSR register. The detailed master
receiver mode timing diagram is shown in the following figure.
Data Frame
In the master receiver mode, data is transmitted from the slave device. Once a data is received by
the master device, the RXDNE flag in the I2CSR register is set but it will not hold the SCL line.
However, if the device receives a complete new data byte and the RXDNE flag has already been set