14-4
Seiko Epson Corporation
S1C31D50 TECHNICAL MANUAL
(Rev. 1.00)
14.3.
Clock Settings
14.3.1.
SPIA Operating Clock
Operating clock in master mode
In master mode, the SPIA operating clock is supplied from the 16-bit timer. The following two
options are pro- vided for the clock configuration.
Use the 16-bit timer operating clock without dividing
By setting the SPIA_
n
MOD.NOCLKDIV bit to 1, the operating clock CLK_T16_
m
, which is configured
by selecting a clock source and a division ratio, for the 16-bit timer channel corresponding to the
SPIA channel is input to SPIA as CLK_SPIA
n
. Since this clock is also used as the SPI clock SPICLK
n
without changing, the CLK_SPIA
n
frequency becomes the baud rate.
To supply CLK_SPIA
n
to SPIA, the 16-bit timer clock source must be enabled in the clock
generator. It does not matter how the T16_
m
CTL.MODEN and T16_
m
CTL.PRUN bits of the
corresponding 16-bit timer channel are set (1 or 0).
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 SPIA_
n
MOD.NOCLKDIV bit to 0, SPIA inputs the underflow signal generated by the
corresponding 16-bit timer channel and converts it to the SPICLK
n
. The 16-bit timer must be run with
an appropriate reload data set. The SPICLK
n
frequency (baud rate) and the 16-bit timer reload data
are calculated by the equations shown below.
𝑓𝑆𝑃𝐼𝐶𝐿𝐾 =
𝑓𝐶𝐿𝐾_𝑆𝑃𝐼𝐴
2 × (𝑅𝐿𝐷 + 1)
𝑅𝐿𝐷 =
𝑓𝐶𝐿𝐾_𝑆𝑃𝐼𝐴
fSPICLK × 2
− 1 (𝐸𝑞. 14.1)
Where
fSPICLK:
SPICLKn frequency [Hz] (= baud rate [bps])
fCLK_SPIA:
SPIA operating clock frequency [Hz]
RLD:
16-bit timer reload data value
For controlling the 16-bit timer
, refer to the “16
-bit T
imers” chapte
r.
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.
Summary of Contents for S1C31D50
Page 461: ...25 1 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 25 Package TQFP12 48PIN ...
Page 462: ...25 2 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP13 64PIN ...
Page 463: ...25 3 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 TQFP14 80PIN ...
Page 464: ...25 4 Seiko Epson Corporation S1C31D50 TECHNICAL MANUAL Rev 1 00 QFP15 100PIN ...