19 UNIVERSAL SERIAL INTERFACE WITH LCD INTERFACE (USIL)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
19-29
Transmit buffer empty interrupt
To use this interrupt, set STDIE/USIL_SIE register to 1. If STDIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
When transmit data written to the transmit data buffer is transferred to the shift register, the USIL module sets
STDIF/USIL_SIF register to 1, indicating that the transmit data buffer is empty. If transmit buffer empty inter-
rupts are enabled (STDIE = 1), an interrupt request is sent simultaneously to the ITC. An interrupt occurs if
other interrupt conditions are met. You can inspect the STDIF flag in the interrupt handler routine to determine
whether the USIL (SPI master/slave mode) interrupt is attributable to a transmit buffer empty. If STDIF is 1, the
next transmit data can be written to the transmit data buffer by the interrupt handler routine.
Receive buffer full interrupt
To use this interrupt, set SRDIE/USIL_SIE register to 1. If SRDIE is set to 0 (default), interrupt requests for
this cause will not be sent to the ITC.
If a received data is loaded into the receive data buffer, the USIL module sets SRDIF/USIL_SIF register to 1.
If receive buffer full interrupts are enabled (SRDIE = 1), an interrupt request is sent simultaneously to the ITC.
An interrupt occurs if other interrupt conditions are met. You can inspect the SRDIF flag in the interrupt han-
dler routine to determine whether the USIL (SPI master/slave mode) interrupt is attributable to a receive buffer
full. If SRDIF is 1, the received data can be read from the receive data buffer by the interrupt handler routine.
However, be sure to check whether a receive error has occurred or not.
Receive error interrupt
To use this interrupt, set SEIE/USIL_SIE register to 1. If SEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
The USIL module sets SEIF/USIL_SIF register to 1 if an overrun error is detected when receiving data. If
receive error interrupts are enabled (SEIE = 1), an interrupt request is sent simultaneously to the ITC. An inter-
rupt occurs if other interrupt conditions are met. You can inspect the SEIF flags in the interrupt handler routine
to determine whether the USIL (SPI master/slave mode) interrupt was caused by a receive error. If SEIF is 1,
the interrupt handler routine will proceed with error recovery.
To reset an overrun error, clear SEIF by writing 1 and then read the receive data buffer (USIL_RD
register)
twice.
Interrupts in I
19.7.3
2
C Master Mode
The I
2
C master mode includes a function for generating the following two different types of interrupts.
• Operation completion interrupt
• Receive error interrupt
Operation completion interrupt
To use this interrupt, set IMIE/USIL_IMIE register to 1. If IMIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
When the operation that initiated by a software trigger has completed, the USIL module sets IMIF/USIL_IMIF
register to 1. If operation completion interrupts are enabled (IMIE = 1), an interrupt request is sent simultaneous-
ly to the ITC. An interrupt occurs if other interrupt conditions are met. You can inspect the IMSTA[2:0]/USIL_
IMIF register in the interrupt handler routine to determine the I
2
C operation/status that causes the interrupt.
7.3.1 I
Table 19.
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)