CHAPTER 15 SERIAL INTERFACE IICA
Page 476 of 920
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. After that, the master generates a stop condition or restart condition. Exit from the
communication status occurs in this way.
Figure 15 - 38 Slave Operation Flowchart (1)
Remark1.
Conform to the specifications of the product that is in communication, regarding the transmission and reception formats.
Remark2.
n = 0, 1
Communication
direction flag = 1?
Communication
direction flag = 1?
Ready flag = 1?
ACKDn = 1?
Communication
mode flag = 1?
Writing IICAn
Clearing communication
mode flag
WRELn = 1
Clearing ready flag
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Starts
transmission.
No
Communication
mode flag = 1?
Yes
No
Setting port
IICCTLn0
←
0XX011XXB
ACKEn = WTIMn = 1, SPIEn = 0
IICCTLn0
←
1XX011XXB
IICEn = 1
In
itia
l s
ett
in
g
C
o
m
m
uni
ca
tion
p
ro
ce
ss
ing
SVAn
←
XXH
Sets a local address.
IICWLn, IICWHn
←
XXH
START
Setting port
Selects a transfer clock.
IICFn
←
0XH
Setting IICRSVn
Sets a start condition.
Setting IICCTLn1
Communication
direction flag = 1?
Communication
mode flag = 1?
Reading IICAn
Clearing ready flag
WRELn = 1
Yes
Yes
No
No
Starts
reception.
Ready flag = 1?
Yes
No
SPIEn = 1
Setting the PER0 register
Release the serial interface IICA from the reset status and start clock supply.
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
).
Set the port from input mode to output mode and enable the output of the I
2
C bus
(see
Summary of Contents for RL78/G1H
Page 941: ...R01UH0575EJ0120 RL78 G1H...