STMicroelectronics STM32F05 series Reference Manual page 482

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

Inter-integrated circuit (I
When a STOP is received and the STOPIE bit is set in the I2Cx_CR1 register, the STOPF
flag is set in the I2Cx_ISR register and an interrupt is generated. In most applications, the
SBC bit is usually programmed to '0'. In this case, If TXE = 0 when the slave address is
received (ADDR=1), you can choose either to send the content of the I2Cx_TXDR register
as the first data byte, or to flush the I2Cx_TXDR register by setting the TXE bit in order to
program a new data byte.
In Slave Byte Control mode (SBC=1), the number of bytes to be transmitted must be
programmed in NBYTES in the address match interrupt subroutine (ADDR=1). In this case,
the number of TXIS events during the transfer corresponds to the value programmed in
NBYTES.
Caution:
When NOSTRETCH=1, the SCL clock is not stretched while the ADDR flag is set, so you
cannot flush the I2Cx_TXDR register content in the ADDR subroutine, in order to program
the first data byte. The first data byte to be sent must be previously programmed in the
I2Cx_TXDR register:
This data can be the data written in the last TXIS event of the previous transmission
message.
If this data byte is not the one to be sent, the I2Cx_TXDR register can be flushed by
setting the TXE bit in order to program a new data byte. The STOPF bit must be
cleared only after these actions, in order to guarantee that they are executed before the
first data transmission starts, following the address acknowledge.
If STOPF is still set when the first data transmission starts, an underrun error will be
generated (the OVR flag is set).
If you need a TXIS event, (Transmit Interrupt or Transmit DMA request), you must set
the TXIS bit in addition to the TXE bit, in order to generate a TXIS event.
482/742
2
C) interface
Doc ID 018940 Rev 1
RM0091

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