
NUC126
Aug. 08, 2018
Page
590
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
register.
Master/Slave Mode
This SPI controller can be set as Master or Slave mode by setting the SLAVE (SPIx_CTL[18]) to
communicate with the off-chip SPI slave or master device. The HALFDPX (SPIx_CTL[14]) can be used
to select the full-duplex or half-duplex in SPI transmission. The application block diagrams in Master
and Slave mode are shown below.
SPIx_CLK
SPIx_MISO
SPIx_MOSI
SPIx_SS
SPIx_CLK
SPIx_DO
SPIx_DI
SPIx_SS
Note: x = 0, 1
M0564 Series
SPI Master
Slave
Figure 6.16-3 SPI Full-Duplex Master Mode Application Block Diagram
SPIx_CLK
SPIx_MISO
SPIx_MOSI
SPIx_SS
SPIx_CLK
SPIx_DI
SPIx_DO
SPIx_SS
Note: x = 0, 1
M0564 Series
SPI Slave
Master
Figure 6.16-4 SPI Full-Duplex Slave Mode Application Block Diagram
Slave Selection
In Master mode, the SPI controller can drive off-chip slave device through the slave select output pin
SPIx_SS. In Slave mode, the off-chip master device drives the slave selection signal from the
SPIx_SS input port to this SPI controller. The duration between the slave select active edge and the
first SPI clock input shall over 3 SPI peripheral clock cycles of slave.
In Master/Slave mode, the active state of slave selection signal can be programmed to low or high
active in SSACTPOL (SPIx_SSCTL[2]). The selection of slave select conditions depends on what type
of device is connected. In Slave mode, to recognize the inactive state of the slave selection signal, the
inactive period of the slave selection signal must be larger than or equal to 3 peripheral clock cycles
between two successive transactions.
Timing Condition
The CLKPOL (SPIx_CTL[3]) defines the SPI clock idle state. If CLKPOL = 1, the output SPI clock is
idle at high state; if CLKPOL = 0, it is idle at low state.
TXNEG (SPIx_CTL[2]) defines the data transmitted out either on negative edge or on positive edge of
SPI clock. RXNEG (SPIx_CTL[1]) defines the data received either on negative edge or on positive