Datasheet
Section 17 I
2
C Bus Interface 2 (IIC2)
Page 1052 of 1408 R01UH0309EJ0500 Rev. 5.00
Sep 24, 2012
H8S/2456, H8S/2456R, H8S/2454 Group
No
Yes
RDRF=1 ?
No
Yes
RDRF=1 ?
Last receive
- 1?
Slave receive mode
Clear AAS in ICSR
Set ACKBT=0 in ICIER
Dummy read ICDRR
Read RDRF in ICSR
Read ICDRR
Set ACKBT=1 in ICIER
Read ICDRR
Read RDRF in ICSR
Read ICDRR
End
No
Yes
RDRF=1 ?
Read RDRF in ICSR
No
Yes
AAS=1 ?
Read AAS in ICSR
No
Yes
Set RIE = 0 in ICIER
Clear STOP in ICSR
Set RIE = 1 in ICIER
STOP=1 ?
Read STOP in ICSR
No
Yes
Clear RDRF in ICSR
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[12]
[14]
[13]
[15]
[1] Determination of slave address*
Use receive-data-full interrupts to determine
whether the slave address matches.
• If the slave address did match (AAS = 1),
execute steps [2] to [11].
• If the slave address did not match (AAS = 0),
execute steps [12] to [15].
[2] Clear the flag AAS.
[3] Set the acknowledge for the transmit device.
[4] Dummy read ICDRR.
[5] Wait the reception end of 1 byte.
[6] Check if the (last receive - 1).
[7] Read the received data.
[8] Set the acknowledge for the last byte.
[9] Read the received data of the (last byte - 1).
[10] Wait the reception end of the last byte.
[11] Read the received data of the last byte.
[12] Receive-data-full interrupt requests
are disabled.
[13] Determined by the stop condition
detection flag.
[14] Clear the RDRF and STOP flags.
[15] Receive-data-full interrupt requests
are enabled.
Additional information: If only one byte is received, steps [2] through [6] are omitted following step [1],
and processing jumps to step [7]. Step [8] is ICDRR dummy read.
Note: * In slave receiver mode, even if the actual and received slave addresses did not match,
received data are stored in ICDRR, after which the RDRF in ICSR is set.
Checking whether or not the addresses matched is thus required.
Figure 17.17 Sample Flowchart for Slave Receive Mode