English
Language : 

UPD78F1502AGK-GAK-AX Datasheet, PDF (639/1031 Pages) Renesas Technology Corp – 16-Bit Single-Chip Microcontrollers
78K0R/Lx3
CHAPTER 15 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 15-30. Slave Operation Flowchart (1)
START
Setting port
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) Port mode register 6 (PM6)).
IICWL, IICWH ← XXH
Selects a transfer clock.
SVA ← XXH
Sets a local address.
IICF ← 0XH
Setting IICRSV
Sets a start condition.
IICCTL0 ← 0XX011XXB
ACKE = WTIM = 1, SPIE = 0
IICCTL0 ← 1XX011XXB
IICE = 1
Setting port
Set the port from input mode to output mode and enable the output of the I2C bus
(see 15.3 (8) Port mode register 6 (PM6)).
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
Writing IICA
Starts
transmission.
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
No
Ready flag = 1?
Yes
Clearing ready flag
Yes
ACKD = 1?
No
Clearing communication
mode flag
WREL = 1
WREL = 1
Starts
reception.
Communication
No
mode flag = 1?
Yes
Communication
No
direction flag = 0?
Yes
No
Ready flag = 1?
Yes
Reading IICA
Clearing ready flag
Remark Conform to the specifications of the product that is in communication, regarding the transmission and
reception formats.
R01UH0004EJ0501 Rev.5.01
623
Jun 20, 2011