RL78/G1P
CHAPTER 12 SERIAL INTERFACE IICA
R01UH0895EJ0100 Rev.1.00
507
Nov 29, 2019
(1) Master operation in single-master system
Figure 12-28. Master Operation in Single-Master System
SPTn = 1
SPTn = 1
WRELn = 1
START
END
ACKEn = 0
WTIMn = WRELn = 1
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
STCENn = 1?
ACKEn = 1
WTIMn = 0
TRCn = 1?
ACKDn = 1?
ACKDn = 1?
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
STTn = 1
IICWLn, IICWHn
XXH
IICFn
0XH
Setting STCENn, IICRSVn = 0
IICCTLn0
1XX111XXB
IICEn = 1
IICCTLn0
0XX111XXB
ACKEn = WTIMn = SPIEn = 1
Setting port
Initializing I
2
C bus
Note
SVAn
XXH
Writing IICAn
Writing IICAn
Reading IICAn
INTIICAn
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 12.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 12.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.
INTIICAn
interrupt occurs?
Waits for detection
of acknowledge.
Prepares for starting communication
(generates a stop condition).
Waits for detection of the stop condition.
INTIICAn
interrupt occurs?
INTIICAn
interrupt occurs?
INTIICAn
interrupt occurs?
Setting IICCTLn1
Note
Release (SCLAn and SDAAn 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 SDAAn pin, for example, set the SCLAn pin in
the output port mode, and output a clock pulse from the output port until the SDAAn pin is constantly at high level.
Remarks 1.
Conform to the specifications of the product that is communicating, with respect to the transmission and
reception formats.
2.
n = 0, 1