RL78/G13 CHAPTER 13 SERIAL INTERFACE IICA
R01UH0146EJ0100 Rev.1.00 742
Sep 22, 2011
(1) Master operation in single-master system
Figure 13-28. Master Operation in Single-Master System
SPT0 = 1
SPT0 = 1
WREL0 = 1
START
END
ACKE0 = 0
WTIM0 = WREL0 = 1
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
STCEN0 = 1?
ACKE0 = 1
WTIM0 = 0
TRC0 = 1?
ACKD0 = 1?
ACKD0 = 1?
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
STT0 = 1
IICWL0, IICWH0 ← XXH
IICF0 ← 0XH
Setting STCEN0, IICRSV0 = 0
IICCTL00 ← 1XX111XXB
IICE0 = 1
IICCTL00 ← 0XX111XXB
ACKE0 = WTIM0 = SPIE0 = 1
Setting port
Initializing I
2
C bus
Note
SVA0 ← XXH
Writing IICA0
Writing IICA0
Reading IICA0
INTIICA0
interrupt occurs?
End of transfer?
End of transfer?
Restart?
Setting of the port used alternatively as the pin to be used.
First, set the port to input mode and the output latch to 0 (see 13.3 (8) Port mode register 6 (PM6)).
Setting port
Set the port from input mode to output mode and enable the output of the I
2
C bus
(see 13.3 (8) Port mode register 6 (PM6)).
Sets a transfer clock.
Sets a local address.
Sets a start condition.
Prepares for starting communication
(generates a start condition).
Starts communication
(specifies an address and transfer
direction).
Waits for detection of acknowledge.
Waits for data transmission.
Starts transmission.
Communication processing
Initial setting
Starts reception.
Waits for data
reception.
INTIICA0
interrupt occurs?
Waits for detection
of acknowledge.
Prepares for starting communication
(generates a stop condition).
Waits for detection of the stop condition.
INTIICA0
interrupt occurs?
INTIICA0
interrupt occurs?
INTIICA0
interrupt occurs?
Note Release (SCLA0 and SDAA0 pins = high level) the I
2
C bus in conformance with the specifications of the product
that is communicating. If EEPROM is outputting a low level to the SDAA0 pin, for example, set the SCLA0 pin in
the output port mode, and output a clock pulse from the output port until the SDAA0 pin is constantly at high
level.
Remark Conform to the specifications of the product that is communicating, with respect to the transmission and
reception formats.