
Rev. 1.00
400 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
19 Inter-Integrated Circuit (I2C)
19 Inter-Integrated Circuit (I2C)
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 10-bit address is sent and the
acknowledge signal from the slave device is received. The second time the ADRS bit is set is
when the 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
to 1, the RXBF bit in the I2CSR register will be set to 1 and the SCL line will be held at a logic low
state. When this situation occurs, data from the I2CDR register should be read to continue the data
transfer process. The RXDNE flag can be cleared after reading the I2CDR register.