
22 SERIAL PERIPHERAL INTERFACE 1
204
EPSON
S1C38000 TECHNICAL MANUAL
22 Serial Peripheral Interface 1
22.1 Overview
The S1C38000 has two Serial Peripheral Interface channels. The first channel (SPI1) can be
configured as master or slave, supports 1 to 16 bit transfers, provides 0 to 65535 clocks of delay
between transfers, and can generate internal interrupts. Both transmit and receive data is buffered.
The SPI1 uses a 5-pin implementation: in master mode, a data ready input (SRDY1#) can be used to
initiate data transfer.
22.2 Master Mode
When SPI1 is configured as master, it controls data transfers to and from the slave connected to SPI
bus. The SPI1 drives the serial clock, SCLK1, and shifts data out through the MOSI1 pin and data in
through the MISO1 pin. The slave select pin, SS1#, is not required for the SPI transfer operation, but
it may be used to detect mode-fault error. A mode-fault error occurs in a multi-master SPI system in
which more than one device is configured as master at the same time. When SPI1 detects a low state
on SS1# in master mode, a mode-fault interrupt is generated and the SPI1 is automatically re-
configured to slave mode to prevent signal contention. If mode-fault error detection is not required,
the SS1# pin may be configured as an General Purpose I/O.
After enabling the SPI1, a data transfer begins when the host writes to the transmit data register
(TXD). Optionally, the data transfer may be held until there is an active low trigger in the SRDY1#
input pin. Both edge and level trigger on SRDY1# is supported.
Figure 22-1 shows the functional flow in master mode.
22.3 Slave Mode
When SPI1 is configured as slave, an external SPI master controls data transfers to and from the
SPI1. The SPI1 receives the serial clock, SCLK1, from the master, which is used to shift data in
through the MOSI1 pin and data out through the MISO1 pin. The slave select pin, SS1#, becomes an
input and is used to enable the serial clock. SS1# must be low in order for the transfer to occur.
After enabling the SPI1, a data transfer is initiated by the external SPI master. Transfer occurs until
an internal counter, which is clocked by the SCLK1 clock, equals the Bit Per Transfer setting.
Figure 22-2 shows the functional flow in slave mode.