19 UNIVERSAL SERIAL INTERFACE WITH LCD INTERFACE (USIL)
19-28
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
USIL Interrupts and DMA
19.7
This section describes the USIL interrupts generated in each interface mode and invoking DMA.
For more information on interrupt processing and DMA transfer, see the “Interrupt Controller (ITC)” chapter and
the “DMA Controller (DMAC)” chapter, respectively.
USIL outputs one interrupt signal shared by the all interrupt causes to the interrupt controller (ITC). Inspect the in-
terrupt flags available in each mode to determine the interrupt cause occurred.
Interrupts in UART Mode
19.7.1
The UART mode includes a function for generating the following three different types of interrupts.
• Transmit buffer empty interrupt
• Receive buffer full interrupt
• Receive error interrupt
Transmit buffer empty interrupt
To use this interrupt, set UTDIE/USIL_UIE register to 1. If UTDIE 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
UTDIF/USIL_UIF register to 1, indicating that the transmit data buffer is empty. If transmit buffer empty inter-
rupts are enabled (UTDIE = 1), an interrupt request is sent simultaneously to the ITC. An interrupt occurs if
other interrupt conditions are met. You can inspect the UTDIF flag in the interrupt handler routine to determine
whether the USIL (UART mode) interrupt is attributable to a transmit buffer empty. If UTDIF 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 URDIE/USIL_UIE register to 1. If URDIE 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 URDIF/USIL_UIF register to
1. If receive buffer full interrupts are enabled (URDIE = 1), an interrupt request is sent simultaneously to the
ITC. An interrupt occurs if other interrupt conditions are met. You can inspect the URDIF flag in the interrupt
handler routine to determine whether the USIL (UART mode) interrupt is attributable to a receive buffer full.
If URDIF 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 UEIE/USIL_UIE register to 1. If UEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
The USIL module sets an error flag (UPEIF/USIL_UIF register, USEIF/USIL_UIF register, or UOEIF/USIL_
UIF register) to 1 if a parity error, framing error, or overrun error is detected when receiving data. If receive
error interrupts are enabled (UEIE = 1), an interrupt request is sent simultaneously to the ITC. If other interrupt
conditions are satisfied, an interrupt occurs. You can inspect the UPEIF, USEIF, and UOEIF flags in the inter-
rupt handler routine to determine whether the USIL (UART mode) interrupt was caused by a receive error. If
any of the error flags has the value 1, the interrupt handler routine will proceed with error recovery.
To reset an overrun error, perform USIL software reset (write 0x0 to USILMOD[2:0]/USIL_GCFG register) to
initialize USIL.
Interrupts in SPI Mode
19.7.2
The SPI master/slave modes include a function for generating the following three different types of interrupts.
• Transmit buffer empty interrupt
• Receive buffer full interrupt
• Receive error interrupt