Figure 233. Transfer Bus Diagrams For Smbus Slave Transmitter (Sbc=1) - ST STM32F412 Reference Manual

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

RM0402

Figure 233. Transfer bus diagrams for SMBus slave transmitter (SBC=1)

Example SMBus slave transmitter 2 bytes + PEC,
NBYTES
EV1: ADDR ISR: check ADDCODE, program NBYTES=3, set PECBYTE, set ADDRCF
EV2: TXIS ISR: wr data1
EV3: TXIS ISR: wr data2
SMBus Slave receiver
When the FMPI2C is used in SMBus mode, SBC must be programmed to '1' in order to
allow the PEC checking at the end of the programmed number of data bytes. In order to
allow the ACK control of each byte, the reload mode must be selected (RELOAD=1). Refer
to
Slave byte control mode on page 670
In order to check the PEC byte, the RELOAD bit must be cleared and the PECBYTE bit
must be set. In this case, after NBYTES-1 data have been received, the next received byte
is compared with the internal FMPI2C_PECR register content. A NACK is automatically
generated if the comparison does not match, and an ACK is automatically generated if the
comparison matches, whatever the ACK bit value. Once the PEC byte is received, it is
copied into the FMPI2C_RXDR register like any other data, and the RXNE flag is set.
In the case of a PEC mismatch, the PECERR flag is set and an interrupt is generated if the
ERRIE bit is set in the FMPI2C_CR1 register.
If no ACK software control is needed, the user can program PECBYTE=1 and, in the same
write operation, program NBYTES with the number of bytes to be received in a continuous
flow. After NBYTES-1 are received, the next received byte is checked as being the PEC.
Caution:
The PECBYTE bit has no effect when the RELOAD bit is set.
Fast-mode Plus Inter-integrated circuit (FMPI2C) interface
ADDR
TXIS TXIS
S
Address
A
data1
EV1
EV2
EV3
A
A
PEC
data2
3
for more details.
RM0402 Rev 6
legend:
transmission
reception
SCL stretch
NA
P
MS19869V2
697/1163
722

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F412 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF