Renesas RL78/G1P Hardware User Manual page 526

16-bit single-chip microcontroller
Hide thumbs Also See for RL78/G1P:
Table of Contents

Advertisement

RL78/G1P
(1) Master operation in single-master system
Note Release (SCLAn and SDAAn pins = high level) the I
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
R01UH0895EJ0100 Rev.1.00
Nov 29, 2019
Figure 12-28. Master Operation in Single-Master System
START
2
Note
Initializing I
C bus
Setting of the port used alternatively as the pin to be used.
Setting port
First, set the port to input mode and the output latch to 0 (see 12.3.8 Port mode register 6 (PM6)).
IICWLn, IICWHn  XXH
Sets a transfer clock.
SVAn  XXH
Sets a local address.
IICFn  0XH
Sets a start condition.
Setting STCENn, IICRSVn = 0
Setting IICCTLn1
IICCTLn0  0XX111XXB
ACKEn = WTIMn = SPIEn = 1
IICCTLn0  1XX111XXB
IICEn = 1
Set the port from input mode to output mode and enable the output of the I
Setting port
(see 12.3.8 Port mode register 6 (PM6)).
Yes
STCENn = 1?
No
Prepares for starting communication
SPTn = 1
(generates a stop condition).
INTIICAn
No
interrupt occurs?
Waits for detection of the stop condition.
Yes
Prepares for starting communication
STTn = 1
(generates a start condition).
Starts communication
Writing IICAn
(specifies an address and transfer
direction).
INTIICAn
No
interrupt occurs?
Waits for detection of acknowledge.
Yes
No
ACKDn = 1?
Yes
No
TRCn = 1?
Yes
Writing IICAn
Starts transmission.
INTIICAn
No
interrupt occurs?
Waits for data transmission.
Yes
No
ACKDn = 1?
Yes
No
End of transfer?
Yes
No
Restart?
SPTn = 1
Yes
CHAPTER 12 SERIAL INTERFACE IICA
ACKEn = 1
WTIMn = 0
WRELn = 1
INTIICAn
interrupt occurs?
Yes
Reading IICAn
End of transfer?
Yes
ACKEn = 0
WTIMn = WRELn = 1
INTIICAn
interrupt occurs?
Yes
END
2
C bus in conformance with the specifications of the product
2
C bus
Starts reception.
No
Waits for data
reception.
No
No
Waits for detection
of acknowledge.
507

Advertisement

Table of Contents
loading

Table of Contents