Inter-integrated circuit (I2C) interface
When the SMBus master wants to send a RESTART condition after the PEC, software
mode must be selected (AUTOEND=0). In this case, once NBYTES-1 have been
transmitted, the I2C_PECR register content is transmitted and the TC flag is set after the
PEC transmission, stretching the SCL line low. The RESTART condition must be
programmed in the TC interrupt subroutine.
Caution:
The PECBYTE bit has no effect when the RELOAD bit is set.
Example SMBus master transmitter 2 bytes + PEC, automatic end mode (STOP)
NBYTES
INIT: program Slave address, program NBYTES = 3, AUTOEND=1, set PECBYTE, set START
EV1: TXIS ISR: wr data1
EV2: TXIS ISR: wr data2
Example SMBus master transmitter 2 bytes + PEC, software end mode (RESTART)
S
INIT
xx
NBYTES
INIT: program Slave address, program NBYTES = 3, AUTOEND=0, set PECBYTE, set START
EV1: TXIS ISR: wr data1
EV2: TXIS ISR: wr data2
EV3: TC ISR: program Slave address, program NBYTES = N, set START
1102/1461
Figure 303. Bus transfer diagrams for SMBus master transmitter
TXIS TXIS
S
Address
A
data1
EV1
INIT
EV2
TXE
xx
TXIS TXIS
Address
A
data1
A
EV1
EV2
3
A
data2
A
3
data2
A
PEC
RM0453 Rev 1
legend:
PEC
A
P
TC
A
Rstart
Address
EV3
N
RM0453
transmission
reception
SCL stretch
legend:
transmission
reception
SCL stretch
MS19871V2
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?
Questions and answers