18 UNIVERSAL SERIAL INTERFACE (USI)
18-10
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
Data Transfer in I
18.5.3
2
C Mode
Control method in I
2
C master mode
Data transfer in I
2
C master mode is controlled using IMTGMOD[2:0]/USI_IMTG register and IMTG/USI_
IMTG register. Select an I
2
C master operation using IMTGMOD[2:0] and write 1 to IMTG as the trigger. The
I
2
C controller controls the I
2
C bus to generate the specified operating status.
5.3.1 Trigger List in I
Table 18.
2
C Master Mode
IMTGMOD[2:0]
Trigger
0x7
Reserved
0x6
ACK/NAK reception
0x5
NAK transmission
0x4
ACK transmission
0x3
Data reception
0x2
Data transmission
0x1
Stop condition
0x0
Start condition
(Default: 0x0)
Writing 1 to IMTG sets IMBSY/USI_IMIF register to 1 indicating that the I
2
C controller is busy (operating).
When the specified operation has finished, IMBSY is reset to 0. At the same time, the interrupt flag (IMIF/USI_
IMIF register) is also set to 1. After an interrupt occurs, read the status bits (IMSTA[2:0]/USI_IMIF register) to
check the operation finished. Then clear IMIF by writing 1. IMSTA[2:0] will be automatically cleared to 0x0.
5.3.2 I
Table 18.
2
C Master Status Bits
IMSTA[2:0]
Status
0x7
Reserved
0x6
NAK has been received.
0x5
ACK has been received.
0x4
ACK or NAK has been sent.
0x3
End of receive data.
0x2
End of transmit data.
0x1
Stop condition has been generated.
0x0
Start condition has been generated.
(Default: 0x0)
Data transmission in I
2
C master mode
The following describes the data transmission procedure in I
2
C master mode.
START
END
Generate start condition
Generate stop condition
Send slave address and transfer
direction bit
ACK received?
yes
ACK received?
yes
no
Finished?
yes
Send data
Error handling
no
no
5.3.1 I
Figure 18.
2
C Master Data Transmission Flow Chart