AT32WB415
Series Reference Manual
2022.04.13
Page 123
Ver 2.00
7-bit address mode:
1.
Set MACKCTRL=1 in the I2C_CTRL1 register
2.
Generate Start condition (GENSTART=1)
3.
EV1: Start condition is ready (STARTF=1). Read STS1 and write the address to DT register.
4.
EV2: Address is matched successfully (ADDR7F=1). Clear the ACKEN bit and read STS1
before reading STS2 and clearing ADDR7F bit, the master enters receive state at this time.
5.
EV2: TDC=1, set GENSTOP=1, and then read the I2C_DT register twice.
6.
End of communication.
10-bit address mode:
1.
Set MACKCTRL=1 in the I2C_CTRL1 register
2.
Generate Start condition (GENSTART=1)
3.
EV1: Start condition is ready (STARTF=1). Read STS1 and write the address to DT register.
4.
EV4: 10-bit address head is sent. Read STS1 and write to DT register can clear the
ADDRHF bit.
5.
EV2: Address is matched successfully (ADDR7F=1). Read STS1 and then STS2 will clear
the ADDR7F bit, and the master re-send Start condition.
6.
EV1: Start condition is ready (STARTF=1). Read STS1 and write the address to the DT
register.
7.
EV2: Address is matched successfully (ADDR7F=1). Clear the ACKEN bit and read STS1
before reading STS2 and clearing ADDR7F bit, the master enters receive state at this time.
8.
EV3: TDC=1, set GENSTOP=1, and then read the I2C_DT register twice.
9.
End of communication.
4.
When I2C interrupt priority is not very high but the number of bytes to receive is equal to 1
After the address is matched, clear the ACKEN bit and then ADDR7F bit, then set the GENSTOP
bit in the I2C_CTRL1 register. Wait until the RDBF bit is set 1 before reading the DT register.
Figure 11-9 Transfer sequence of master receiver when N=1
Address
S
1
A
Data1
NA
SCL
Stretch
P
Master to Slave
Slave to Master
RS = Repeated Start
S = Start
A = Acknowledge
P = Stop
Example : I2C Master receive 1 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, clear the I2C_CTRL1_ACKEN bit, and
reading STS1 and then STS2 will clear the event, then set the
I2C_CTRL1_GENSTOP bit = 1.
EV3. I2C_STS1_RDBF =1,reading the I2C_DT register will clear the
event.
EV4. I2C_STS1_ADDR7F = 1, reading STS1 and then STS2 will
clear the event.
EV5. I2C_STS1_ADDRHF= 1, reading STS1 and write I2C_DT
register will clear the event.
EV2
EV3
RDBF
Address Head
S
A
SCL
Stretch
Address
A
EV4
EV5
10-bit address
Address Head
RS
SCL Stretch
A
Data1
NA
SCL Stretch
P
EV2
EV3
7-bit address
R/W
0
R/W
1
R/W
SCL
Stretch
EV1
SCL
Stretch
EV1
SCL Stretch
EV1