NEC 78K0 Series User Manual page 447

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0 Series:
Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents