
Inter-integrated circuit (I
2
C) interface
RM0008
740/1096
Doc ID 13902 Rev 12
Arbitration lost (ARLO)
This error occurs when the I
2
C interface detects an arbitration lost condition. In this case,
●
the ARLO bit is set by hardware (and an interrupt is generated if the ITERREN bit is
set)
●
the I
2
C Interface goes automatically back to slave mode (the M/SL bit is cleared). When
the I
2
C loses the arbitration, it is not able to acknowledge its slave address in the same
transfer, but it can acknowledge it after a repeated Start from the winning master.
●
lines are released by hardware
Overrun/underrun error (OVR)
An overrun error can occur in slave mode when clock stretching is disabled and the I
2
C
interface is receiving data. The interface has received a byte (RxNE=1) and the data in DR
has not been read, before the next byte is received by the interface. In this case,
●
The last received byte is lost.
●
In case of Overrun error, software should clear the RxNE bit and the transmitter should
re-transmit the last received byte.
Underrun error can occur in slave mode when clock stretching is disabled and the I
2
C
interface is transmitting data. The interface has not updated the DR with the next byte
(TxE=1), before the clock comes for the next byte. In this case,
●
The same byte in the DR register will be sent again
●
The user should make sure that data received on the receiver side during an underrun
error are discarded and that the next bytes are written within the clock low time
specified in the I
2
C bus standard.
For the first byte to be transmitted, the DR must be written after ADDR is cleared and before
the first SCL rising edge. If not possible, the receiver must discard the first data.
26.3.5
SDA/SCL line control
●
If clock stretching is enabled:
–
Transmitter mode: If TxE=1 and BTF=1: the interface holds the clock line low
before transmission to wait for the microcontroller to read SR1 and then write the
byte in the Data Register (both buffer and shift register are empty).
–
Receiver mode: If RxNE=1 and BTF=1: the interface holds the clock line low after
reception to wait for the microcontroller to read SR1 and then read the byte in the
Data Register (both buffer and shift register are full).
●
If clock stretching is disabled in Slave mode:
–
Overrun Error in case of RxNE=1 and no read of DR has been done before the
next byte is received. The last received byte is lost.
–
Underrun Error in case TxE=1 and no write into DR has been done before the next
byte must be transmitted. The same byte will be sent again.
–
Write Collision not managed.