![ARTERY AT32F435 Series Скачать руководство пользователя страница 175](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592175.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 175
Rev 2.03
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 m aster transm ission 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