![ARTERY AT32F435 Series Скачать руководство пользователя страница 187](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592187.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 187
Rev 2.03
Figure 11-15 SMBus master transmission tim ing
Address
S
r/w
A
Data1
A
SCL
Stretch
Data2
A
P
Master to Slave
Slave to Master
S = Start
A = Acknowledge
P = Stop
SMBus master transmitter N bytes + PEC
Initial setting flow :
1. I2C_CTRL2_CNT = N+ 1
2. I2C_CTRL2_SADDR = slave address
3. I2C_CTRL2_ASTOPEN = 1
4. I2C_CTRL1_PECEN = 1
5. I2C_CTRL2_PECTEN = 1
6. 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
PEC
EV5
EV1
DataN
A
Initial setting
SM Bus master receive flow
Figure 11-16 SMBus master receive flow
Master initialization
I2C_STS_RDBF=1?
Set I2C_CTRL2_CNT = N+1
I2C_CT RL1_PE CEN=1
I2C_CT RL2_PE CTEN=1
Configure slave address
GENSTART = 1
Yes
No
Read I2C_RXDT_DT
CNT
received?
I2C_STS_TDC = 1 ?
Wait I2C_STS_STOPF=1
Set I2C_CLR_STOPC=1
No
Yes
Yes
(ASTOPEN = 0)
No
(ASTOPEN = 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