RM0091
If the SMBus master wants to send a STOP condition after the PEC, automatic end mode
should be selected (AUTOEND=1). In this case, the STOP condition automatically follows
the PEC transmission.
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 I2Cx_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.
Figure 224. Bus transfer diagrams for SMBus master transmitter
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
TXIS TXIS
S
Address
A
data1
EV1
INIT
EV2
TXE
xx
TXIS TXIS
Address
A
data1
A
EV1
EV2
3
Doc ID 018940 Rev 1
Inter-integrated circuit (I
A
data2
A
3
data2
A
PEC
legend:
PEC
A
P
TC
A
Rstart
Address
EV3
N
2
C) interface
transmission
reception
SCL stretch
legend:
transmission
reception
SCL stretch
MS19871V1
511/742
Need help?
Do you have a question about the STM32F05 series and is the answer not in the manual?