AT32F425
Series Reference Manual
2022.03.30
Page 122
Ver 2.01
―
Wait for the generation of a STOP condition, when a STOP condition is generated, STOPF=1
is asserted in the I2C_STS register. The STOPF flag can be cleared by setting STOPC=1 in
the I2C_CLR register, and then transfer stops
When the host receives an NACK signal during transmission, then ACKFAIL is set in the I2C_STS
register, and a STOP condition is sent to stop communication, whatever mode (either ASTOPEN=0
or ASTOPEN=1
).
Master transmitter
Figure 11-4 I
2
C master transmission flow
Master initialization
I2C_STS_TDIS=1?
No
Set I2C_CTRL2_CNT = N,
( if N > 255 , CNT = 0xFF, N=N-
255 ,RLDEN = 1) ,Configure slave
address, and GENSTART = 1.
I2C_STS_ACKFAIL=1?
Yes
Yes
No
Write I2C_TXDT_DT
CNT
Transmitted?
I2C_STS_TDC = 1 ?
No
No
Yes
Yes
(ASTOPEN = 0)
I2C_STS_TCRLD = 1 ?
Yes
No
(ASTOPEN = 1)
N<256 ?
CNT = N, RLDEN=0
Yes
CNT = 0xFF, N=N-255, RLDEN=1
No
Wait I2C_STS_STOPF=1
Set I2C_CLR_STOPC=1
I2C_CLR_ACKFAILC=1
Set I2C_CTRL2_GENSTOP = 1
Wait I2C_STS_STOPF=1
Set I2C_CLR_STOPC=1
Restart ?
Configure CNT and slave address
GENSTART = 1
No
Yes
Wait I2C_STS_STOPF=1
Set I2C_CLR_STOPC=1