STM32 SPI Lecture 8 : NSS setting in STM32 master and slave mode

  • Post author:
  • Post category:Blog

 

NSS setting in STM32 master and slave mode

 

 


In this article, let’s understand about slave select pin management or NSS pin management.

There are two scenarios.

  1. Slave mode
  2. Master mode
NSS setting in STM32 master and slave mode
Figure1. The scenario of a single master and a single slave.

 

When the device in slave mode, the NSS pin works as standard “chip select” input and lets the slave communicates with the master.

When the device is in master mode, the NSS pin either used as input or output. So as an input pin, NSS will avoid multi-master bus collision. That means when the device is in master mode, the multi-master collision capability can achieve by using the NSS pin as an input. That means, the SPI can have multiple masters.

But in standard communication, when the device is in master mode, always keep the NSS pin as an output. When the NSS pin is in output mode, it can drive a slave select signal of the single slave.

From Figure 1. Let’s assume that the slave is an STM32 microcontroller which is in slave mode. The master is an STM32 microcontroller, which is in master mode. Here, no need to use the NSS pin. But, if you want to use that pin, then make it as input in the slave side and output on the master side. From the slave side, it just acts like a standard slave select pin.

In the following article, let’s see Hardware and software slave managements

 

FastBit Embedded Brain Academy Courses

Click here: https://fastbitlab.com/course1

FastBitLab

The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.

Leave a Reply