Renesas RL78/G1P Hardware User Manual page 531

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

Advertisement

RL78/G1P
The main processing of the slave operation is explained next.
Start serial interface IICA and wait until communication is enabled. When communication is enabled, execute
communication by using the communication mode flag and ready flag (processing of the stop condition and start
condition is performed by an interrupt. Here, check the status by using the flags).
The transmission operation is repeated until the master no longer returns ACK. If ACK is not returned from the
master, communication is completed.
For reception, the necessary amount of data is received. When communication is completed, ACK is not returned
as the next data.
communication status occurs in this way.
Remarks 1.
Conform to the specifications of the product that is in communication, regarding the transmission and
reception formats.
2.
n = 0, 1
R01UH0895EJ0100 Rev.1.00
Nov 29, 2019
After that, the master generates a stop condition or restart condition.
Figure 12-30. Slave Operation Flowchart (1)
START
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
Selects a transfer clock.
SVAn  XXH
Sets a local address.
IICFn  0XH
Sets a start condition.
Setting IICRSVn
Setting IICCTLn1
IICCTLn0  0XX011XXB
ACKEn = WTIMn = 1, SPIn = 0
IICCTLn0  1XX011XXB
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)).
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
Starts
Writing IICAn
transmission.
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
No
Ready flag =
1?
Yes
Clearing ready flag
Yes
ACKDn = 1?
No
Clearing communication
mode flag
WRELn = 1
CHAPTER 12 SERIAL INTERFACE IICA
Starts
WRELn = 1
reception.
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
No
Ready flag =
1?
Yes
Reading IICAn
Clearing ready flag
Exit from the
2
C bus
512

Advertisement

Table of Contents
loading

Table of Contents