Inter-Integrated Circuit Controller
7-88
-
Poll receive data: Poll the receive data ready interrupt flag bit (RRDY) in
the I
2
C status register (I2C_STAT), use the RRDY interrupt, or use the
DMA to read the receive data in the data receive register (I2C_DATA).
-
Poll transmit data: Poll the transmit data ready interrupt flag bit (XRDY) in
the I
2
C status register (I2C_STAT), use the XRDY interrupt, or use the
DMA to write data into the data transmit register (I2C_DATA).
Interrupt subroutines:
1) Test for arbitration lost and resolve accordingly.
2) Test for no-acknowledge and resolve accordingly.
3) Test for register access ready and resolve accordingly.
4) Test for receive data and resolve accordingly.
5) Test for transmit data and resolve accordingly.
7.8.4
Flowcharts
Figure 7–31 through Figure 7–42 show the master/slave I
2
C flowcharts.
Figure 7–31. Setup Procedure
Start
Write I
2
C_OA.
Write I
2
C_IE.
Write I
2
C_SCLL.
Write I
2
C_SCLH.
Use
repeat mode
(RM=1)
?
Write I
2
C_CNT.
No
Yes
Write I
2
C_SA.
End