AT32F425
Series Reference Manual
2022.03.30
Page 123
Ver 2.01
Figure 11-5 Transfer sequence of I
2
C master transmitter
Address
S
r/w
A
Data1
A
SCL
Stretch
Data2
A
P
Master to Slave
Slave to Master
S = Start
A = Acknowledge
P = Stop
I2C master transmitter N bytes
Initial setting flow :
1. I2C_CTRL2_CNT = N
2. I2C_CTRL2_SADDR = slave address
3. I2C_CTRL2_ASTOPEN = 1
4. I2C_CTRL2_GENSTART = 1
EV1. I2C_STS_ADDRF=1,set I2C_CLR_ADDRC=1
EV2. I2C_STS_TDIS = 1, write Data1
EV3. I2C_STS_TDIS = 1, write Data2
EV4. I2C_STS_TDIS = 1, write Data3
EV5. I2C_STS_TDIS = 1, write DataN
EV6. I2C_STS_STOPF =1, set I2C_CLR_STOPC =1
TDIS
EV3
EV2
EV4
EV6
A
DataN
EV5
EV1
Initial setting
Master receiver
Figure 11-6 I
2
C master receive flow
Master initialization
I2C_STS_RDBF=1?
Set I2C_CTRL2_CNT = N ,
( if N > 255 , CNT = 0xFF, N=N-
255 ,RLDEN = 1) ,Configure slave
address, and GENSTART = 1.
Yes
No
Read I2C_RXDT_DT
CNT
received?
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
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