AT32WB415
Series Reference Manual
2022.04.13
Page 119
Ver 2.00
Receiver: First send slave address head 0b11110xx0 (where xx refers to address [9:8]) and then
address [7: 0], followed by the address head 0b11110xx1 (where xx refers to address [9: 8]), the
master enters receiver mode.
Master transmitter
Figure 11-5 Transfer sequence of master transmitter
Address
S
0
A
Data1
A
SCL
Stretch
Data2
A
DataN
A
P
Master to Slave
Slave to Master
S = Start
A = Acknowledge
P = Stop
Example : I2C Master transfer N bytes to I2C Slave .
EV1. I2C_STS1_STARTF=1, reading STS1 and write the address to I2C_DT will
clear the event.
EV2. I2C_STS1_ADDR7F= 1, reading STS1 and then STS2 will clear the event.
EV3. Both the internal shift register and the data register I2C_DT are empty,
I2C_STS1_TDBE = 1, the data is directly moved to the internal shift register
after Data1 is written.
EV4. I2C_DT writes Data, I2C_STS1_TDBE = 0
。
EV5. I2C_STS1 register TDBE and TDC bit = 1, software sets the stop condition to
clear the event
EV6. I2C_STS1_ADDRHF= 1,reading STS1 and write I2C_DT register will clear
the event.
EV2
EV3
EV4
EV5
...
TDBE
EV4
Address Head
S
A
Address
SCL
Stretch
A
Data1
A
Data2
A
DataN
A
P
EV4
EV5
...
EV4
SCL Stretch
EV2
EV4
EV4
EV6
7-bit address
10-bit address
R/W
0
R/W
SCL
Stretch
SCL
Stretch
EV1
EV1
EV3
7-bit address mode:
1.
Generate a Start condition (GENSTART=1)
2.
EV1: Start condition is ready (STARTF=1). Read STS1 and write the address to DT register.
3.
EV2: Address is matched successfully (ADDR7F=1). Read STS1 and then STS2 will clear the
ADDR7F bit. In this case, the master enters transmit stage, and both DT register and internal shift
regiser are empty. The TDBE bit is set 1 by hardware.
4.
EV3: When the data is written to the DT register, it is directly moved to the shift register and the
SCL bus is released. The TDBE bit is still set 1 at this time.
5.
EV4: At this point, the DT register is empty but the shift register is full. Writing to the DT register
will clear the TDBE bit.
6.
The TDBE bit is set only after the second-to-last byte is sent.
7.
EV5: TDC=1 indicates that the byte transmission is complete. The master sends Stop condition
(STOPF=1). The TDBE bit and TDC bit is cleared by hardware.
8.
End of communication.
10-bit address mode:
1.
Generate Start condition (GENSTART=1)
2.
EV1: Start condition is ready (STARTF=1). Read STS1 and write the address to DT register.
3.
EV6: 10-bit address head sequence is sent. Read STS1 and write to DT register can clear the
ADDRHF bit.
4.
EV2: Address is matched successfully (ADDR7F=1). Read STS1 and then STS2 will clear the
ADDR7F bit. In this case, the master enters transmit stage, and both DT register and internal shift
regiser are empty. The TDBE bit is set 1 by hardware.