
V PeRiPheRaL MoDuLes 3 (inteRFaCe): seRiaL PeRiPheRaL inteRFaCe (sPi)
s1C33L17 teChniCaL ManuaL
ePson
V-3-5
V
SPI
setting the sPi_CLK polarity and phase
Use CPOL (D8/0x301708) to select the SPI_CLK clock polarity. The SPI_CLK is configured as active low
when CPOL (D8/0x301708) is set to 1 or active high when CPOL (D8/0x301708) is set to 0 (default).
CPoL: SPI_CLK Polarity Select Bit in the SPI Control Register 1 (D8/0x301708)
The SPI_CLK clock phase is selected with CPHA (D9/0x301708).
CPha: SPI_CLK Phase Select Bit in the SPI Control Register 1 (D9/0x301708)
Setting these control bits determines the transfer timing as in the figure shown below.
SPI_CLK (CPOL = 1, CPHA = 1)
SPI_CLK (CPOL = 1, CPHA = 0)
SPI_CLK (CPOL = 0, CPHA = 1)
SPI_CLK (CPOL = 0, CPHA = 0)
SDI/SDO
Fetching receive data
into shift register
1 to 32 bits
MSB
LSB
Figure V.3.4.1 Clock and Data Transfer Timing
setting the inter-character wait cycle
1 to 65536 SPI_CLK clocks of delay time can be inserted between data transfers (in each transfer for specified
number of data bits) using the SPI Wait Register (0x301710). The value set in the register (0 to 65535) + 1 is
used as the number of wait cycles.
setting the receive data mask
(1) RXME (D1/0x30171C) = 0 (default)
The SPI Receive Data Register (0x301700) will receive the data bits specified with BPT[4:0] (D[14:10]/
0x301708) + 1. The ineffective upper bits are masked with 0.
(2) RXME (D1/0x30171C) = 1
This setting enables user specified bit mask. The SPI receive buffer will receive the data bits specified with
BPT[4:0] (D[14:10]/0x301708) + 1. The ineffective upper bits are masked with 0. Then only the effective
data bits specified with RXMASK[4:0] (D[14:10]/0x30171C) + 1 in the receive data buffer are loaded to
the SPI Receive Data Register (0x301700). The ineffective upper bits are masked with 0.
RXMe: Receive Data Mask Enable Bit in the SPI Receive Data Mask Register (D1/0x30171C)
RXMasK[4:0]: Receive Data Mask Setup Bits in the SPI Receive Data Mask Register (D[14:10]/0x30171C)
Figure V.3.4.2 shows the relationship between the mask control bit settings and the receive data loaded to the
SPI Receive Data Register (0x301700).
D0
Dn
0
D0
Shift register
SPI Receive Data Register
RXME = 0 (default)
Valid data
BPT[4:0] + 1 (bits)
0
Dm
D0
Shift register
SPI receive buffer
SPI Receive Data Register
RXME = 1
Dn
Masked
D31
RXMASK[4:0] + 1 (bits)
D0
Dn
0
D0
BPT[4:0] + 1 (bits)
Dn
Masked
D31
Masked
Figure V.3.4.2 Receive Data Mask