![ARTERY AT32F435 Series Reference Manual Download Page 193](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592193.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 193
Rev 2.03
Overrun/underrun
OUF
ERRIEN
OUFC
Arbitration lost
ARLOST
ERRIEN
ARLOSTC
Bus error
BUSERR
ERRIEN
BUSERRC
Overrun/Underrun (OUF)
In slave mode, an underrun/overrun may appear if the clock stretching feature is disabled (STRETCH=1
in the I2C_CTRL1 register)
In slave transmit mode: if data has not yet been written to the TXDT register before the transmission of
the first bit of the to-be-transferred data (that is, before the generation of SDA edge), an underrun error
may occur, and the OUF bit is set in the I2C_STS register, sending 0xFF to the bus.
In slave receive mode: The slave must read the received data in the case of the clock stretching being
disabled (STRETCH=1). If one-byte data has been received and data is not read yet before the end of
the next data reception, an overrun error occurs, setting the OUF bit in the I2C_STS register, and
sending NCAK.
Arbitration lost (ARLOST)
An arbitration lost may occur when the device controls the SDA line to output high level but the actual
bus output is low.
―
Master transmit: An arbitration may occur during an address transfer and a data transfer
―
Master receive: An arbitration may occur during an address transfer and an ACK response
―
Slave transmit: An arbitration may occur during a data transfer
―
Slave receive: An arbitration may occur during an ACK response
Once an arbitration lost is detected, the ARLOST is set by hardware in the I2C_STS register. The SCL
and SDA buses will be released and go automatically back to slave mode.
Bus error (BUSERR)
The SDA line, during a data transfer, must be kept in a stable state when the SCL is in high level. The
SDA can be changed only when the SCL signal becomes low, otherwise, a bus error may appear. When
the SCL is high:
―
SDA changes from 1 to 0: a misplaced START condition
―
SDA changes from 0 to 1: a misplaced STOP condition
Both of these conditions above may trigger a bus error. Once it occurs, the BUSERR is set by hardware
in the I2C_STS register.
Packet error checking (PECERR)
The PEC is available only in SMBus mode. In master receive and slave receive modes, a PEC error
may appear if the received PEC is not equal to the internally calculated PEC. In this case, the PECERR
bit is set by hardware in the I2C_STS register
In slave receive mode, an NACK is sent when a PEC error is detected.
In master receive mode, an NACK is always sent, whatever the PEC check result.
SMBus alert (ALERTF)
The SMBus alert feature is present when HADDREN=1 (SMBus master mode) and SMBALERT=1
(SMBus alert mode).Once an alert event is detected on the ALERT pin (ALERT pin changes from high
to low), the ALERTF bit is set by hardware in the I2C_STS register.
Timeout error (TMOUT)
SMBus defines a timeout mechanism for the improvement of the system stability, preventing the bus
from being pulled down in the case of a master or slave failure. Once a timeout event (defined in SMBus
chapter) is detected, the TMOUT is set by hardware in the I2C_STS register. If a timeout error occurs in
slave mode, the SCL and SDA buses are immediately released; if a timeout error occurs in master mode,
a STOP condition is automatically by host to abort the communication