18 UNIVERSAL SERIAL INTERFACE (USI)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
18-21
Receive buffer full interrupt
To use this interrupt, set URDIE/USI_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 USI module sets URDIF/USI_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 USI (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/USI_UIE register to 1. If UEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
The USI module sets an error flag (UPEIF/USI_UIF register, USEIF/USI_UIF register, or UOEIF/USI_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 interrupt handler routine to determine whether the USI (UART mode) interrupt was caused by a re-
ceive error. If any of the error flags has the value 1, the interrupt handler routine will proceed with error recov-
ery.
To reset an overrun error, perform USI software reset (write 0x0 to USIMOD[2:0]/USI_GCFG register) to ini-
tialize USI.
Interrupts in SPI Mode
18.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
Transmit buffer empty interrupt
To use this interrupt, set STDIE/USI_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 USI module sets
STDIF/USI_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 USI (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/USI_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 USI module sets SRDIF/USI_SIF register to 1. If re-
ceive 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 handler
routine to determine whether the USI (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. How-
ever, be sure to check whether a receive error has occurred or not.
Receive error interrupt
To use this interrupt, set SEIE/USI_SIE register to 1. If SEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.