
M0A21/M0A23 Series
May 06, 2022
Page
535
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
Figure 6.14-9 SPI Communication with Different SPI Clock Configuration (SCLKMODE=0x3)
Slave Select Signal
The slave selection signal of SPI protocol is active high by default. In SPI Master mode, the USCI
controller can drive the control signal to off-chip SPI Slave device through slave select pin SPI_SS
(USCIx_CTL0). In SPI Slave mode, the received slave select signal can be inverted by ININV
(USPI_CTLIN0[2]).
If the slave select signal of external SPI Master device is low active, the ININV (USPI_CTLIN0[2]) setting
of slave device should be set to 1 for the inversion of input control signal. If USCI operates as SPI Master
mode, the output slave select inversion CTLOINV (USPI_LINECTL[7]) is also needed to set as 1 for the
external SPI Slave device whose slave select signal is active low.
The duration between the slave select active edge and the first SPI clock input edge shall over 2 USCI
peripheral clock cycles.
The input slave select signal of SPI Slave has to be keep inactive for at least 2 USCI peripheral clock
cycles between two consecutive frames in order to correctly detect the end of a frame.
Transmit and Receive Data
The bit length of a transmit/receive data word in SPI protocol of USCI controller is defined in DWIDTH
(USPI_LINECTL[11:8]), and it can be configured up to 16-bit length for transmitting and receiving data
in SPI communication.
The LSB bit (USPI_LINECTL[0]) defines the order of transfer data bit. If the LSB bit is set to 1, the
transmission data sequence is LSB first. If the LSB bit is cleared to 0, the transmission data sequence
is MSB first.
Data N
Data (N+1)
Data Frame
SPI_SS
(USCIx_CTL0)
SPI_MOSI
(USCIx_DAT0)
SPI_CLK
(USCIx_CLK)
SPI_MISO
(USCIx_DAT1)
MSB
TX[n]
TX
[n-1]
RX
[n-1]
MSB
RX[n]
MSB
TX[n]
TX
[n-1]
LSB
TX[0]
LSB
RX[0]
RX
[n-1]
MSB
RX[n]
LSB
TX[0]
LSB
RX[0]
Note:
x = 0, 1
USCI_PROTCTL[0] = 0;
USCI_PROTCTL[7:6] = 0x3;
USCI_CTLIN0[2] = 1;
USCI_LINECTL[0] = 0;
USCI_LINECTL[7] = 1;