15 Quad Synchronous Serial Interface (QSPI)
15-26
Seiko Epson Corporation
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
15.5.9 Data Transfer in Slave Mode
A data sending/receiving procedure and operations in slave mode are shown below. Figures 15.5.9.1 and 15.5.9.2
show a timing chart and flowcharts, respectively.
Data sending procedure
1. Check to see if the QSPI_
n
INTF.TBEIF bit is set to 1 (transmit buffer empty).
2. Write transmit data to the QSPI_
n
TXD register.
3. Wait for a transmit buffer empty interrupt (QSPI_
n
INTF.TBEIF bit = 1).
4. Repeat Steps 2 and 3 until the end of transmit data.
Note: Transmit data must be written to the QSPI_nTXD register after the QSPI_nINTF.TBEIF bit is set
to 1 by the time the sending QSPI_nTXD register data written is completed. If no transmit data is
written during this period, the data bits input from the QSDIOn pins are shifted and output from
the QSDIOn pins without being modified.
Data receiving procedure
1. Wait for a receive buffer full interrupt (QSPI_
n
INTF.RBFIF bit = 1).
2. Read the received data from the QSPI_
n
RXD register.
3. Repeat Steps 1 and 2 until the end of data reception.
Data transfer operations
The following shows the slave mode operations different from master mode:
• Slave mode operates with the QSPI clock supplied from the external QSPI master to the QSPICLK
n
pin. The
data transfer rate is determined by the QSPICLK
n
frequency. It is not necessary to control the 16-bit timer.
• QSPI can operate as a slave device only when the slave select signal input from the external QSPI master
to the #QSPISS
n
pin is set to the active (low) level. If #QSPISS
n
= high, the software transfer control, the
QSPICLK
n
pin input, and the QSDIO
n
pins input are all ineffective. If the #QSPISS
n
signal goes high dur-
ing data transfer, the transfer bit counter is cleared and data in the shift register is discarded.
• Slave mode starts data transfer when QSPICLK
n
is input from the external QSPI master after the #QSPISS
n
signal is asserted. Writing transmit data is not a trigger to start data transfer. Therefore, it is not necessary to
write dummy data to the transmit data buffer when performing data reception only.
• Data transmission/reception can be performed even in SLEEP mode, it makes it possible to wake the CPU up
using a QSPI interrupt.
Other operations are the same as master mode.
Notes: • If data of the number of cycles specified by the QSPI_nMOD.CHLN[3:0] bits is received when
the QSPI_nINTF.RBFIF bit is set to 1, the QSPI_nRXD register is overwritten with the newly re-
ceived data and the previously received data is lost. In this case, the QSPI_nINTF.OEIF bit is set.
• When the clock for the first bit is input from the QSPICLKn pin, QSPI starts sending the data
currently stored in the shift register even if the QSPI_nINTF.TBEIF bit is set to 1.
#QSPISSn
QSPICLKn
QSDIOn[3:0]
QSPI_nINTF.TBEIF
QSPI_nINTF.RBFIF
Software operations
1
2
1
2
3
4
1
2
3
4
1
2
3
4
Data (W)
→
QSPI_nTXD
Data (W)
→
QSPI_nTXD
Data (W)
→
QSPI_nTXD
QSPI_nRXD
→
Data (R)
QSPI_nRXD
→
Data (R)
Figure 15.5.9.1 Example of Data Transfer Operations in Slave Mode
(QSPI_nMOD.CHDL[3:0] bits = QSPI_nMOD.CHLN[3:0] bits = 0x3)