14 SYNCHRONOUS SERIAL INTERFACE (SPIA)
14-4
Seiko Epson Corporation
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
f
CLK_SPIA
f
CLK_SPIA
f
SPICLK
= ——— ————
RLD = ————— - 1 (Eq. 14.1)
2
×
(RLD + 1)
f
SPICLK
×
2
Where
f
SPICLK
: SPICLK
n
frequency [Hz] (= baud rate [bps])
f
CLK_SPIA
: SPIA 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
SPIA set in slave mode operates with the clock supplied from the external SPI master to the SPICLK
n
pin. The
16-bit timer channel (including the clock source selector and the divider) corresponding to the SPIA channel is
not used. Furthermore, the SPIA_
n
MOD.NOCLKDIV bit setting becomes ineffective.
SPIA keeps operating using the clock supplied from the external SPI master even if all the internal clocks halt
during SLEEP mode, so SPIA can receive data and can generate receive buffer full interrupts.
14.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 SPIA 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 SPIA 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 SPIA Ch.
n
will keep operating in a debug state.
SPIA in slave mode operates with the external SPI master clock input from the SPICLK
n
pin regardless of whether
the CPU is placed into debug state or normal operation state.
14.3.3 SPI Clock (SPICLKn) Phase and Polarity
The SPICLK
n
phase and polarity can be configured separately using the SPIA_
n
MOD.CPHA bit and the SPIA_
n
MOD.CPOL bit, respectively. Figure 14.3.3.1 shows the clock waveform and data input/output timing in each set-
ting.
SPIA_nMOD register
Cycle No.
SPICLKn
SPICLKn
SPICLKn
SPICLKn
SDIn
(Master mode)
SDOn
(Slave mode)
SDOn
(Slave mode)
SDOn
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 SPIA_nTXD register
Figure 14.3.3.1 SPI Clock Phase and Polarity (SPIA_nMOD.LSBFST bit = 0, SPIA_nMOD.CHLN[3:0] bits = 0x7)