572
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
The software slave device management is enabled when SPI_CTRL1.SSMEN = 1.
The NSS pin is not used in software NSS mode. In this mode the internal NSS signal level is driven by writing the
SPI_CTRL1.SSEL bit (master mode SPI_CTRL1.SSEL = 1, slave mode SPI_CTRL1.SSEL = 0).
Hardware NSS mode
The software slave device management is disabled when SPI_CTRL1.SSMEN = 0.
NSS input mode: The NSS output of the master device is disabled (SPI_CTRL1.MSEL = 1, SPI_CTRL2.SSOEN =
0), allowing operation in multi-master mode. The master should connect NSS pin to the high level and the slave
should connect NSS pin to the low level during the entire data frame transfer.
NSS output mode: NSS output of the master device is enable (SPI_CTRL1.MSEL = 1, SPI_CTRL2.SSOEN = 1).
SPI as the master device must pull the NSS pin to low level, all device which connected to the master device and set
to NSS hardware mode, will detect low level and enter the slave mode automatically. If the master device cannot pull
the NSS pin to low level, device will enter the slave mode and generates the master mode failure error.
Note: The choice of software mode or hardware mode depends on whether NSS control is needed in the
communication protocol. If not, you can choose the software mode, and release a GPIO pin for other purposes.
Figure 21-2 Selective management of hardware/software
The following figure is an example of the interconnection of single master and single slave devices
0
1
SSEL
SSMEN
Internal NSS
External NSS