18 UNIVERSAL SERIAL INTERFACE (USI)
18-14
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
0x0
Address
0x6
0x2
0x3
A6
A5
D7
D6
D5
D4
D3
D2
D1
D0
A4
A3
A2
A1
A0 R/W = 1
ACK
USI_CK pin (output)
USI_CK pin (input)
USI_DI pin (output)
USI_DI pin (input)
IMTGMOD[2:0]
IMTG (write)
IMBSY
IMSTA[2:0]
TD[7:0]
RD[7:0]
IMIF
Start interrupt
End of transmission
interrupt
End of reception
interrupt
Receive
ACK interrupt
0x0
*
*
*
*
0x2
0x5
0x3
(1) Start condition
→
Data reception
0x4
0x5
0x3
0x1
D7
D6
D5
D4
D3
D2
D1
D0
ACK
USI_CK pin (output)
USI_CK pin (input)
USI_DI pin (output)
USI_DI pin (input)
IMTGMOD[2:0]
IMTG (write)
IMBSY
IMSTA[2:0]
RD[7:0]
IMIF
Stop interrupt
End of reception
interrupt
Transfer
NAK interrupt
Transfer
ACK interrupt
NAK
Received data (n - 1)
Received data n
*
*
*
*
0x3
0x4
0x4
0x1
(2) Data reception
→
Stop condition
*
When IMIF is cleared via software, IMSTA[2:0] is also cleared to 0x0.
5.3.9 I
Figure 18.
2
C Master Data Receiving Timing Chart
Note: The timing chart above shows a basic transfer operation that does not include an actual I
2
C trans-
fer procedure. See “Receiving control byte in I
2
C slave mode” in “18.9 Precautions.”
(1) Generating start condition
The procedure is the same as that of data transmission in I
2
C master mode.
(2) Sending slave address and transfer direction bit
The procedure is the same as that of data transmission in I
2
C master mode. However, send the slave address
with the transfer direction bit set to 1. Then check that the slave device sends back an ACK.
(3) Data reception
To start data reception, set IMTGMOD[2:0] to 0x3 and write 1 to IMTG.
This trigger starts outputting 8 clocks from the USI_CK pin. The USI_DO pin status is sampled in sync
with the clock and loaded to the shift register. The received data is loaded to the receive data buffer (RD[7:0]/
USI_RD register) once the 8-bit data has been received in the shift register.
Writing 1 to IMTG sets IMBSY to 1. When the received data is loaded to the receive data buffer, IMBSY
reverts to 0 and IMSTA[2:0] is set to 0x3 (end of receive data). An interrupt request can be generated at this
point. Read the received data from the receive data buffer using this interrupt.
It is necessary to send back an ACK or NAK to the slave device after an 8-bit data has been received.
To send back an ACK, set IMTGMOD[2:0] to 0x4 and write 1 to IMTG. To send back a NAK, set
IMTGMOD[2:0] to 0x5 and write 1 to IMTG.
IMBSY is set to 1 while an ACK/NAK is being sent and it reverts to 0 when the transmission has complet-
ed. An interrupt can be generated at this point. When an ACK or NAK has been sent, IMSTA[2:0] is set to
0x4.
Repeat an 8-bit data reception and ACK (NAK) transmission for the required number of times.
(4) Generating stop condition
The procedure is the same as that of data transmission in I
2
C master mode.