15 Quad Synchronous Serial Interface (QSPI)
S1C31D50/D51 TECHNICAL MANUAL
Seiko Epson Corporation
15-7
(Rev. 2.00)
When setting this mode, the timer function of the corresponding 16-bit timer channel may be used for an-
other purpose.
Use the 16-bit timer as a baud rate generator
By setting the QSPI_
n
MOD.NOCLKDIV bit to 0, the QSPI inputs the underflow signal generated by the
corresponding 16-bit timer channel and converts it to the QSPICLK
n
. The 16-bit timer must be run with an
appropriate reload data set. The QSPICLK
n
frequency (baud rate) and the 16-bit timer reload data are cal-
culated by the equations shown below.
f
CLK_QSPI
f
CLK_QSPI
f
QSPICLK
= ——— ————
RLD = —————— - 1
(Eq. 15.1)
2
×
(RLD + 1)
f
QSPICLK
×
2
Where
f
QSPICLK
: QSPICLK
n
frequency [Hz] (= baud rate [bps])
f
CLK_QSPI
: QSPI operating clock frequency [Hz]
RLD:
16-bit timer reload data value
For controlling the 16-bit timer, refer to the “16-bit Timers” chapter.
Operating clock in slave mode
The QSPI set in slave mode operates with the clock supplied from the external SPI/QSPI master to the QSPI-
CLK
n
pin. The 16-bit timer channel (including the clock source selector and the divider) corresponding to the
QSPI channel is not used. Furthermore, the QSPI_
n
MOD.NOCLKDIV bit setting becomes ineffective.
The QSPI keeps operating using the clock supplied from the external SPI/QSPI master even if all the internal
clocks halt during SLEEP mode, so the QSPI can receive data and can generate receive buffer full interrupts.
15.3.2 Clock Supply During Debugging
In master mode, the operating clock supply during debugging should be controlled using the T16_
m
CLK.DBRUN
bit.
The CLK_T16_
m
supply to QSPI Ch.
n
is suspended when the CPU enters debug state if the T16_
m
CLK.DBRUN
bit = 0. After the CPU returns to normal operation, the CLK_T16_
m
supply resumes. Although QSPI Ch.
n
stops
operating when the CLK_T16_
m
supply is suspended, the output pins and registers retain the status before the de-
bug state was entered. If the T16_
m
CLK.DBRUN bit = 1, the CLK_T16_
m
supply is not suspended and QSPI Ch.
n
will keep operating in a debug state.
The QSPI in slave mode operates with the external SPI/QSPI master clock input from the QSPICLK
n
pin regard-
less of whether the CPU is placed into debug state or normal operation state.
15.3.3 QSPI Clock (QSPICLKn) Phase and Polarity
The QSPICLK
n
phase and polarity can be configured separately using the QSPI_
n
MOD.CPHA bit and the QSPI_
n
MOD.CPOL bit, respectively. Figure 15.3.3.1 shows the clock waveform and data input/output timing in each set-
ting.
QSPI_nMOD register
Cycle No.
QSPICLKn
QSPICLKn
QSPICLKn
QSPICLKn
(Input)
QSDIOn
(Master mode, output)
QSDIOn
(Slave mode, output)
QSDIOn
(Slave mode, output)
QSDIOn
1
CPHA bit
1
0
1
0
x
x
1
0
CPOL bit
1
1
0
0
x
x
x
x
2
3
4
5
6
7
8
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
Writing data to the QSPI_nTXD register
Figure 15.3.3.1 QSPI Clock Phase and Polarity (QSPI_nMOD.LSBFST bit = 0, QSPI_nMOD.CHLN[3:0] bits = 0x7)