
NUC126
Aug. 08, 2018
Page
591
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
edge of SPI clock.
Note:
The settings of TXNEG and RXNEG are mutual exclusive. In other words, do not transmit and
receive data at the same clock edge.
Transmit/Receive Bit Length
The bit length of a transaction word is defined in DWIDTH (SPIx_CTL[12:8]) and can be configured up
to 32-bit length in a transaction word for transmitting and receiving.
When SPI controller finishes a transaction, i.e. receives or transmits a specific count of bits
defined in DWIDTH (SPIx_CTL[12:8]), the unit transfer interrupt flag will be set to 1.
SPIx_CLK
SPIx_MOSI
SPIx_MISO
TX[30]
TX[16]
TX[15] TX[14]
LSB
TX[0]
RX[30]
RX[16]
RX[14]
LSB
RX[0]
MSB
RX[31]
RX[15]
MSB
TX[31]
SPIx_SS
Figure 6.16-532-Bit in One Transaction
LSB/MSB First
LSB (SPIx_CTL[13]) defines the bit transfer sequence in a transaction. If the LSB (SPIx_CTL[13]) is
set to 1, the transfer sequence is LSB first. The bit 0 will be transferred firstly. If the LSB
(SPIx_CTL[13]) is cleared to 0, the transfer sequence is MSB first.
Suspend Interval
SUSPITV (SPIx_CTL[7:4]) provides a configurable suspend interval, 0.5 ~ 15.5 SPI clock periods,
between two successive transaction words in Master mode. The definition of the suspend interval is
the interval between the last clock edge of the preceding transaction word and the first clock edge of
the following transaction word. The default value of SUSPITV is 0x3 (3.5 SPI clock cycles).
6.16.5.2 Automatic Slave Selection
In Master mode, if AUTOSS (SPIx_SSCTL[3]) is set, the slave selection signal will be generated
automatically and output to the SPIx_SS pin according to whether SS (SPIx_SSCTL[0]) is enabled or
not. The slave selection signal will be set to active state by the SPI controller when the SPI data
transfer is started by writing to FIFO. It will be set to inactive state when SPI bus is idle. If SPI bus is
not idle, i.e. TX FIFO, TX shift register or TX skew buffer is not empty, the slave selection signal will be
set to inactive state between transactions if the value of SUSPITV (SPIx_CTL[7:4]) is greater than or
equal to 3.
In Master mode, if the value of SUSPITV is less than 3 and the AUTOSS is set as 1, the slave
selection signal will be kept at active state between two successive transactions.
If the AUTOSS bit is cleared, the slave selection output signal will be determined by the SS setting.
The active state of the slave selection output signal is specified in SSACTPOL (SPIx_SSCTL[2]).
The duration between the slave selection signal active edge and the first SPI bus clock edge is 1 SPI
bus clock cycle and the duration between the last SPI bus clock and the slave selection signal inactive
edge is 1.5 SPI bus clock cycle.