CHAPTER 17 SERIAL INTERFACE IIC0
Preliminary User’s Manual U17260EJ3V1UD
447
The main processing of the slave operation is explained next.
Start serial interface IIC0 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 17-25. Slave Operation Flowchart (1)
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
No
START
Communication
mode flag = 1?
Communication
mode flag = 1?
Communication
direction flag = 1?
Ready flag =
1?
Communication
direction flag = 1?
Reading IIC0
Clearing ready flag
Clearing ready flag
Communication
direction flag = 1?
WREL0 = 1
ACKD0 = 1?
Clearing communication
mode flag
WREL0 = 1
Writing IIC0
IICC0
←
XXH
ACKE0 = WTIM0 = 1
SPIE0 = 0, IICE0 = 1
SVA0
←
XXH
Sets a local address.
IICX0
←
0XH
IICCL0
←
XXH
Selects a transfer clock.
IICF0
←
0XH
Setting IICRSV
Sets a start condition.
Starts
transmission.
Starts
reception.
No
Yes
No
Communication
mode flag = 1?
Yes
No
Ready flag =
1?
Remark
Conform to the specifications of the product that is in communication, regarding the transmission and
reception formats.