
AT32F413
Series Reference Manual
2022.06.27
Page 133
Rev 2.00
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 erro checking (PEC) is used to guarantee the correctness and integrity of data transfer. This is
done by using CRC-8 polynominal:
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 transferred after the
last transmitted byte.
DMA mode: The PEC is transferred automatically after the last transmitted byte. For example, if
the number of data to be transferred is 8, then DMA_TCNTx=8.
PEC reception:
Common mode: Set the PECTRA bit after the last RDBF event. The PECTRA must be set before
the ACK pulse of the current byte is received.
DMA mode: When receiving, it will automatically consider the last byte as PECVAL and check it.
For example, if the number of data to be transferred is 8, then DMA_TCNTx=9.
In reception mode, the NACK will be generated when PEC 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