RL78/G1H CHAPTER 15 SERIAL INTERFACE IICA
R01UH0575EJ0120 Rev. 1.20 Page 471 of 920
Dec 22, 2016
(1) Master operation in single master system
Figure 15 - 34 Master Operation in Single-Master System
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.
Remark1. Conform to the specifications of the product that is communicating, with respect to the transmission and reception
formats.
Remark2. n = 0, 1
Communication processing
IICFn ← 0XH
Setting STCENn, IICRSVn = 0
Setting port
IICWLn, IICWHn ← XXH
START
Initializing I
2
C bus
Note
SVAn ← XXH
Writing IICAn
Writing IICAn
SPTn = 1
Reading IICAn
ACKEn = 0
WRELn = 1
ACKEn = 1
WTIMn = 0
SPTn = 1
END
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
STCENn = 1?
INTIICAn
interrupt occurs?
End of transfer?
End of transfer?
Restart?
TRCn = 1?
ACKDn = 1?
ACKDn = 1?
Sets a transfer clock.
Sets a local address.
Sets a start condition.
Starts communication
(specifies an address and transfer direction).
Waits for detection of acknowledge.
Waits for data transmission.
Starts transmission.
Starts reception.
Waits for data reception.
Waits for detection of the stop condition.
No
Yes
Yes
No
INTIICAn
interrupt occurs?
Yes
No
INTIICAn
interrupt occurs?
Yes
No
Yes
No
Yes
No
INTIICAn
interrupt occurs?
STTn = 1
IICCTLn0 ← 0XX111XXB
ACKEn = WTIMn = SPIEn = 1
IICCTLn0 ← 1XX111XXB
IICEn = 1
Setting port
Initial setting
Prepares for starting communication
(generates a start condition).
Prepares for starting communication
(generates a stop condition).
Setting IICCTLn1
No
Yes
INTIICAn
interrupt occurs?
Waits for detection
of acknowledge.
WTIMn = 1
WRELn = 1
Setting the PER0 register
Release the serial interface IICA from the reset status and start clock supply.
Set the port from input mode to output mode and enable the output of the I
2
C bus
(see
15.3.8 Register to control port function of serial I/O pin).
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
15.3.8 Register to control port function of serial I/O pin).