STMicroelectronics STM32F05 series Reference Manual page 508

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

Inter-integrated circuit (I
SMBus Slave receiver
When the I2C 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
Byte Control Mode on page 480
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 I2Cx_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 I2Cx_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 I2Cx_CR1 register.
If no ACK software control is needed, you 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.
508/742
2
C) interface
Doc ID 018940 Rev 1
for more details.
RM0091
Slave

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents