Rev. 1.0, 02/00, page 504 of 1141
Start
End
Initialize
Read BBSY flag in ICCR
Read IRIC flag in ICCR
Read ACKB bit in ICSR
Read ACKB bit in ICSR
Clear IRIC flag in ICCR
Read IRIC flag in ICCR
Write transmit data in ICDR
Master receive mode
Write transmit data in ICDR
Set MST=1 and
TRS=1 in ICCR
Write BBSY=0 and
SCP=0 in ICCR
Write BBSY=1 and
SCP=0 in ICCR
BBSY=0?
No
IRIC=1?
ACKB=0?
No
No
Yes
Yes
Yes
Transmit
mode?
IRIC=1?
End of transmission
(ACKB = 1)?
No
No
No
Yes
Yes
Yes
[1]
[2]
[3]
[4]
[7]
[5]
[6]
[8]
[9]
[10]
Clear IRIC flag in ICCR
Test the status of the SCL and SDA lines.
Select master transmit mode.
Generate a start condition.
Set transmit data for the first byte (slave
aR/W)
Wait for 1 byte to be transmitted.
Test for acknowledgement by the
designated slave device.
Set transmit data for the second and
subsequent bytes.
Wait for 1 byte to be transmitted.
Test for end of transfer.
Generate a stop condition.
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
Figure 23.14 Flowchart for Master Transmit Mode (Example)