Renesas rl78 Answering Machine User Manual


  Open as PDF
of 1004
 
RL78/G1A CHAPTER 13 SERIAL INTERFACE IICA
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 13-30. Slave Operation Flowchart (1)
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No
WRELn = 1
SPIEn = 1
ACKDn = 1?
No
Yes
No
Yes
No
START
Communication
mode flag = 1?
Communication
mode flag = 1?
Communication
direction flag = 1?
Ready flag = 1?
Communication
direction flag = 1?
Reading IICAn
Clearing ready flag
Clearing ready flag
Communication
direction flag = 1?
Clearing communication
mode flag
WRELn = 1
Writing IICAn
SVAn XXH
Sets a local address.
IICWLn, IICWHn XXH
Selects a transfer clock.
IICFn 0XH
Setting IICRSVn
Sets a start condition.
Starts
transmission.
Starts
reception.
Communication
mode flag = 1?
Ready flag = 1?
Setting port
Setting IICCTLn1
Setting port
Communication processing
Initial setting
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 13.3.8 Port mode register 6 (PM6)).
Set the port from input mode to output mode and enable the output of the I
2
C bus
(see 13.3.8 Port mode register 6 (PM6)).
IICCTLn0 0XX011XXB
ACKEn = WTIMn = 1, SPIn = 0
IICCTLn0 1XX011XXB
IICEn = 1
<R>
<R>
Remarks 1. Conform to the specifications of the product that is in communication, regarding the transmission and
reception formats.
2. n = 0
R01UH0305EJ0200 Rev.2.00 615
Jul 04, 2013