19 UNIVERSAL SERIAL INTERFACE WITH LCD INTERFACE (USIL)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
19-21
(1) Waiting for start condition
I
2
C data transfer starts when the I
2
C master device generates a start condition (see Figure 19.5.3.3).
First enable this I
2
C slave to detect a start condition by setting ISTGMOD[2:0] to 0x0 (default) and writing
1 to ISTG. The I
2
C controller starts detecting a start condition and sets ISBSY to 1. ISBSY is set to 1 while
a start condition is being detected. ISBSY reverts to 0 and ISSTA[2:0] is set to 0x0 when the detection has
completed. Check if a start condition is generated by reading ISBSY or using an interrupt.
Note: Other operations cannot be started before a start condition is detected.
(2) Receiving slave address and transfer direction data bit
The I
2
C master sends the address of the slave device to be communicated and a transfer direction bit (see
Figure 19.5.3.4) after it has generated a start condition. Set this I
2
C slave into receiving status to receive the
slave address. To start reception, set ISTGMOD[2:0] to 0x3 and write 1 to ISTG.
This trigger starts sampling clocks input from the USIL_CK pin. When clocks are input, the I
2
C controller
loads the USIL_DO pin status to the shift register in sync with each clock. The received data is loaded to
the receive data buffer (RD[7:0]/USIL_RD register) once the 8-bit data has been received in the shift regis-
ter.
Writing 1 to ISTG sets ISBSY to 1. When the received data is loaded to the receive data buffer, ISBSY
reverts to 0 and ISSTA[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.
When a 7-bit address is used, the slave address and transfer direction bit can be obtained in one operation.
When a 10-bit address is used, save the first data received in the receive data buffer into the memory and
perform data reception again to obtain the remaining address bits.
Check whether the received address is matched to this I
2
C slave address or not. When they are matched,
send back an ACK to the I
2
C master by setting ISTGMOD[2:0] to 0x4 and write 1 to ISTG. ISBSY is set to
1 while an ACK is being sent and it reverts to 0 when the transmission has completed. An interrupt request
can be generated at this point. When an ACK has been sent, ISSTA[2:0] is set to 0x4.
If the received address is not for this I
2
C slave, abort data reception and return to Step (1) to wait the subse-
quent start condition.
(3) Data transmission
When the transfer direction bit received with the slave address in Step (2) is 1, start data transmission by the
following procedure:
1. Write an 8-bit transmit data to the transmit data buffer (TD[7:0]).
2. Set ISTGMOD[2:0] to 0x2 and ISTG to 1.
This trigger transfers the buffer data to the transmit shift register to start transmission. When clocks are in-
put from the USIL_CK pin, the data in the shift register is shifted in sequence with the clock and sent from
the USIL_DO pin.
Writing 1 to ISTG sets ISBSY to 1. When data in the transmit data buffer is sent to the transmit shift reg-
ister, ISBSY reverts to 0 and ISSTA[2:0] is set to 0x2 (end of transmit data). An interrupt request can be
generated at this point. Write subsequent data to the transmit data buffer to start the following transmission
using this interrupt.
However, check that the master device has sent back an ACK or NAK (by setting ISTGMOD[2:0] to 0x6
and ISTG to 1) before starting the following 8-bit data transmission.
ISBSY is set to 1 while an ACK/NAK is being detected and it reverts to 0 when the detection has complet-
ed. Receiving an ACK sets ISSTA[2:0] to 0x5; receiving a NAK sets it to 0x6. Check ISSTA[2:0] after con-
firming ISBSY or using an interrupt. When an ACK has been received, perform data transmission. When a
NAK has been received, perform the appropriate handling.
(4) When a stop condition is received
If the ISSTA[2:0] value read during data transmission is 0x1, the I
2
C master device has generated a stop
condition (see Figure 19.5.3.6). In this case, abort data transmission.