18 UNIVERSAL SERIAL INTERFACE (USI)
18-22
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
The USI module sets SEIF/USI_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 interrupt
occurs if other interrupt conditions are met. You can inspect the SEIF flags in the interrupt handler routine to
determine whether the USI (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 (USI_RD
register) twice.
Interrupts in I
18.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/USI_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 USI module sets IMIF/USI_IMIF
register to 1. If operation completion interrupts are enabled (IMIE = 1), an interrupt request is sent simultane-
ously to the ITC. An interrupt occurs if other interrupt conditions are met. You can inspect the IMSTA[2:0]/
USI_IMIF register in the interrupt handler routine to determine the I
2
C operation/status that causes the inter-
rupt.
7.3.1 I
Table 18.
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)
Receive error interrupt
To use this interrupt, set IMEIE/USI_IMIE register to 1. If IMEIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.
An overrun error occurs at the time a transmit or receive trigger is issued after two-byte data has been received
without reading the receive data buffer.
The USI module sets IMEIF/USI_IMIF register to 1 if an overrun error is detected when receiving data. If
receive error interrupts are enabled (IMEIE = 1), an interrupt request is sent simultaneously to the ITC. An
interrupt occurs if other interrupt conditions are met. You can inspect the IMEIF flags in the interrupt handler
routine to determine whether the USI (I
2
C master mode) interrupt was caused by a receive error. If IMEIF is 1,
the interrupt handler routine will proceed with error recovery.
To reset an overrun error, clear IMEIF by writing 1, and then read the receive data buffer (USI_RD
register)
twice.
Interrupts in I
18.7.4
2
C Slave Mode
The I
2
C slave 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 ISIE/USI_ISIE register to 1. If ISIE is set to 0 (default), interrupt requests for this
cause will not be sent to the ITC.