STM32 SPI Lecture 3 : Importance of SPI slave select pin

 

Importance of SPI slave select pin

 

 


Importance of SPI slave select pin

Chip select (CS) or slave select (SS) is the name of a control line in the SPI bus used to select one (or a set) of the slave device (commonly called “chips”) out of several slave devices connected to the same master device.

Importance of slave select pin
Figure 1. Single Master and Single slave devices.

 

From Figure 1. There is one master device and one slave device and to use the SPI communication between these devices, then both master and slave must support the SPI peripheral or the SPI interface. If the slave doesn’t help SPI interface, then SPI communication between the master and the slave is not possible.

So, when a master wants to communicate with a slave, the first thing master does is, it selects the slave. So, that means the master uses one of its GPIO pins to pull the slave select (SS) pin of the slave to ground.

When the SS pin of the slave pulled to ground, then the only slave will activate the data pins that is, MOSI and MISO pin. Unless slave select pin pulled to 0 or ground, the slave would not enable data communication between master and slave devices because the data pins are in high impedance state or Hi-Z state until the SS pin is 0. So, when master pulls SS pin to ground, then data pins are come out of Hi-Z state.

By connecting GPIO pins of the master to the slave, the program has to select the slave by pulling the slave select to ground. Then the master can send the data as well as receive the data from the slave. Master will send the data to the slave, and the clock must carry along with the data. That means the data communication must be synchronized with the clock signal.

 

In the following article, let’s see SPI minimal bus configuration.

 

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.