14 SYNCHRONOUS SERIAL INTERFACE (SPIA)
14-12
Seiko Epson Corporation
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
14.6 Interrupts
SPIA has a function to generate the interrupts shown in Table 14.6.1.
Table 14.6.1 SPIA Interrupt Function
Interrupt
Interrupt flag
Set condition
Clear condition
End of transmission SPIA_nINTF.TENDIF When the SPIA_nINTF.TBEIF bit = 1 after data
of the specified bit length (defined by the SPIA_
nMOD.CHLN[3:0] bits) has been sent
Writing 1
Receive buffer full
SPIA_nINTF.RBFIF When data of the specified bit length is received
and the received data is transferred from the shift
register to the received data buffer
Reading the SPIA_
nRXD register
Transmit buffer empty SPIA_nINTF.TBEIF When transmit data written to the transmit data
buffer is transferred to the shift register
Writing to the SPIA_
nTXD register
Overrun error
SPIA_nINTF.OEIF
When the receive data buffer is full (when the re-
ceived data has not been read) at the point that
receiving data to the shift register has completed
Writing 1
SPIA provides interrupt enable bits corresponding to each interrupt flag. An interrupt request is sent to the CPU
core only when the interrupt flag, of which interrupt has been enabled by the interrupt enable bit, is set. For more
information on interrupt control, refer to the “Interrupt” chapter.
The SPIA_
n
INTF register also contains the BSY bit that indicates the SPIA operating status.
Figure 14.6.1 shows the SPIA_
n
INTF.BSY and SPIA_
n
INTF.TENDIF bit set timings.
Master mode
SPICLKn
SDOn
SPIA_nINTF.BSY
SPIA_nINTF.TENDIF
SPIA_nMOD register
1
2
3
7
8
CPHA bit
1
0
CPOL bit
1
0
Writing data to the SPIA_nTXD register
Slave mode
#SPISSn
SPIA_nINTF.BSY
SPICLKn
SDOn
SPICLKn
SDOn
SPIA_nINTF.TENDIF
SPIA_nMOD register
1
2
3
7
8
CPHA bit
1
0
CPOL bit
1
0
Writing data to the SPIA_nTXD register
Figure 14.6.1 SPIA_nINTF.BSY and SPIA_nINTF.TENDIF Bit Set Timings (when SPIA_nMOD.CHLN[3:0] bits = 0x7)