CHAPTER 16 I
2
C BUS
User’s Manual U16896EJ2V0UD
517
16.15.1 Master operation in single master system
Figure 16-15. Master Operation in Single Master System
IICX0
←
0XH
IICCL0
←
XXH
IICF0
←
0XH
Set STCEN0, IICRSV0 = 0
IICC0
←
XXH
ACKE0 = WTIM0 = SPIE0 = 1
IICE0 = 1
Set ports
Initialize I
2
C bus
Note
SPT0 = 1
SVA0
←
XXH
Write IIC0
Write IIC0
SPT0 = 1
WREL0 = 1
START
END
Read IIC0
ACKE0 = 0
WTIM0 = WREL0 = 1
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
STCEN0 = 1?
ACKE0 = 1
WTIM0 = 0
INTIIC0
interrupt occurred?
Transfer completed?
Transfer completed?
Restarted?
TRC0 = 1?
ACKD0 = 1?
ACKD0 = 1?
Refer to
Table 4-12 Settings When Port Pins Are Used for Alternate Functions
to set the I
2
C mode before this function is used.
Transfer clock selection
Local address setting
Start condition setting
Communication start preparation
(start condition generation)
Communication start
(address, transfer direction specification)
Waiting for ACK detection
Waiting for data transmission
Transmission start
Comm
unication processing
Initial settings
Reception start
Waiting for
data reception
No
Yes
INTIIC0
interrupt occurred?
Waiting for ACK detection
Communication start preparation
(stop condition generation)
Waiting for stop condition detection
No
Yes
Yes
No
INTIIC0
interrupt occurred?
Yes
No
INTIIC0
interrupt occurred?
Yes
No
Yes
No
Yes
No
INTIIC0
interrupt occurred?
STT0 = 1
Note
Release the I
2
C0 bus (SCL0, SDA0 pins = high level) in conformity with the specifications of the product
in communication.
For example, when the EEPROM
TM
outputs a low level to the SDA0 pin, set the SCL0 pin to the output
port and output clock pulses from that output port until when the SDA0 pin is constantly high level.
Remark
For the transmission and reception formats, conform to the specifications of the product in
communication.