AT32WB415
Series Reference Manual
2022.04.13
Page 120
Ver 2.00
5.
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.
6.
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.
7.
The TDBE bit is set only after the second-to-last byte is sent.
8.
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.
9.
End of communication.
Master receiver
Data reception depends on I
2
C interrupt priority:
1.
Very high priority
When the second-to-last byte is being read, clear the ACKEN bit and set the GENSTOP bit in the
I2C_CTRL1 register to generate Stop condition.
If only one byte is received, clear the ADDR7F flag and set the ACKEN and GENSTOP bit in the
I2C_CTRL1 register.
After the byte is received, the I2C_STS1_RDBF bit is set 1 by hardware, and it is cleared after
the software read the I2C_DT register.
Figure 11-6 Transfer sequence of master receiver
Address
S
1
A
Data1
A
SCL
Stretch
Data2
A
DataN
NA P
Master to Slave
Slave to Master
RS = Repeated Start
S = Start
A = Acknowledge
P = Stop
Example : I2C Master receive N bytes from 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. I2C_STS1_RDBF =1,reading the DT register will clear the event
EV4. I2C_STS1_RDBF =1, read the DT register and set I2C_CTRL1_ACKEN = 0
and I2C_CTRL1_GENSTOP = 1 .
EV5. I2C_STS1_ADDRHF= 1 , reading STS1 and write I2C_DT register will
clear the event .
EV2
EV3
EV4
...
RDBF
Address Head
S
A
SCL
Stretch
Address
A
Data1
A
Data2
A
DataN
NA P
EV3
EV4
...
SCL Stretch
EV3
EV3
EV3
EV3
EV2
EV5
7-bit address
10-bit address
Address Head
RS
SCL
Stretch
A
R/W
0
R/W
SCL
Stretch
EV1
SCL
Stretch
EV1
1
R/W
EV2
SCL
Stretch
EV1
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 receive stage.
4.
EV3: The RDBF bit is set 1 after the byte is received. It is cleared when the I2C_DT register is
read.
5.
EV4: The ACKEN bit is cleared and the GENSTOP is set as soon as the second-to-last byte is
received.
6.
EV3: The RDBF bit is set 1 after receiving the byte, and it is cleared when the I2C_DT register is
read.
7.
End of communication.