
AT32F421
Series Reference Manual
2022.11.11
Page 122
Rev 2.02
1.
When an alert event occurs and the ALERT pin changes from high to low (SMBALERT=1), the
slave responses to ARA (Alert Response Address) address (0001100x)
2.
Enable ALERT interrupt if necessary (an interrupt is generated when receiving ARA address)
3.
Wait until the host gets the slave addresses through ARA
4.
Report its own address, but it continues to wait if the arbitration is lost.
5.
Address is reported properly, and the ALERT pin is released (SMBALERT=0).
Packet error checking (PEC)
Packet error checking (PEC) is used to guarantee the correctness and integrity of data transfer. This is
done by using CRC-8 polynomial:
C(x) = x
8
+ x
2
+ x + 1
PEC calculation is enabled when PECEN=1 to check address and data. It becomes invalid when the
arbitration is lost.
PEC transmission:
Common mode: Set PECTRA=1 after the last TDBE event so that PEC is sent after the last byte.
DMA mode: The PEC is sent automatically after the completion of the last byte transfer. For
example, if the number of data to be transferred is 8, then DMA_TCNTx=8 must be set.
PEC reception:
Common mode: The PECTRA bit is set after the last RDBF event. The PECTRA must be set
before the ACK pulse of the current byte is received.
DMA mode:. The last byte is automatically checked as PECVAL during reception. For instance, if
the number of data to be transferred is 8, then DMA_TCNTx=9 must be set.
In reception mode, the NACK will be generated if PEC check fails.
11.4.5 I
2
C interrupt requests
The following table lists all the I
2
C interrupt requests.
Interrupt event
Event flag
Enable control bit
Start condition sent (Host)
STARTF
EVTIEN
Address sent (host) or address matched (slave)
ADDR7F
10-bit address head sent (host)
ADDRHF
Data transfer complete
TDC
Stop condition received (slave)
STOPF
Transmit data buffer empty
TDBE
EVTIEN and
DATAIEN
Receive data buffer full
RDBF
SMBus alert
ALERTF
ERRIEN
Timeout error
TMOUT
PEC error
PECERR
Overload/underload
OUF
Acknowledge failure
ACKFAIL
Arbitration lost
ARLOST
Bus error
BUSERR