14 SYNCHRONOUS SERIAL INTERFACE (SPIA)
S1C31D50/D51 TECHNICAL MANUAL
Seiko Epson Corporation
14-11
(Rev. 2.00)
• Data transmission/reception can be performed even in SLEEP mode, it makes it possible to wake the CPU up
using an SPIA interrupt.
Other operations are the same as master mode.
Notes: • If data of the number of bits specified by the SPIA_nMOD.CHLN[3:0] bits is received when
the SPIA_nINTF.RBFIF bit is set to 1, the SPIA_nRXD register is overwritten with the newly
received data and the previously received data is lost. In this case, the SPIA_nINTF.OEIF bit
is set.
• When the clock for the first bit is input from the SPICLKn pin, SPIA starts sending the data
currently stored in the shift register even if the SPIA_nINTF.TBEIF bit is set to 1.
#SPISSn
SPICLKn
SDOn
SDIn
SPIA_nINTF.TBEIF
SPIA_nINTF.RBFIF
Software operations
1 2 3
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
Data (W)
→
SPIA_nTXD
Data (W)
→
SPIA_nTXD
Data (W)
→
SPIA_nTXD
SPIA_nRXD
→
Data (R)
SPIA_nRXD
→
Data (R)
Figure 14.5.5.1 Example of Data Transfer Operations in Slave Mode (SPIA_nMOD.CHLN[3:0] bits = 0x7)
Data reception
End
Read receive data from
the SPIA_nRXD register
NO
YES
Receive data remained?
Wait for an interrupt request
(SPIA_nINTF.RBFIF = 1)
Data transmission
End
Read the SPIA_nINTF.TBEIF bit
Write transmit data to
the SPIA_nTXD register
YES
NO
NO
YES
Transmit data remained?
SPIA_nINTF.TBEIF = 1 ?
Wait for an interrupt request
(SPIA_nINTF.TBEIF = 1)
Figure 14.5.5.2 Data Transfer Flowcharts in Slave Mode
14.5.6 Terminating Data Transfer in Slave Mode
A procedure to terminate data transfer in slave mode is shown below.
1. Wait for an end-of-transmission interrupt (SPIA_
n
INTF.TENDIF bit = 1). Or determine end of transfer via the
received data.
2. Set the SPIA_
n
CTL.MODEN bit to 0 to disable the SPIA Ch.
n
operations.