2024-02-29 04:41 AM
I want to communicate with STM32f427 processor and 3 sensors via SPI. I want to use only SPI1 line. I need 3 chip select pins. There are 2 SPI1_NSS pins on the datasheet of the processor. What can I use as 3 CS pins? Is any GPIO pin suitable?
Solved! Go to Solution.
2024-03-01 09:26 PM
YES, all the nCS signal in SPI SW mode - generate the nCS signals yourself (via toggling GPIOs). Works fine (I use it).
Bear in mind: you can (should) use nSS (nCS) in SW mode: you cannot use the intended SPI nSS HW signal in HW mode (it would toggle all the time with a new SPI transaction). All nCS signals are now a GPIO signal. You can use the intended GPIO (pin) for nSS also in GPIO mode: just make sure you do not configure all the nSS signal as SPI nSS signal (instead as a GPIO).
2024-02-29 04:45 AM
Hello,
See this thread. Hope it helps.
2024-02-29 05:27 AM
I'm not sure, please other answers
2024-02-29 07:07 AM
@arslanoglu wrote:Is any GPIO pin suitable?
Yes.
But you will have to manage it manually - which may mean that you also need to manage the other two manually?
2024-02-29 09:35 AM
You need to emulate CS signals by GPIOs .. Each time you need to read from/write to a slave you need to activate its corresponding "chips select" by GPIO pins.
2024-03-01 09:26 PM
YES, all the nCS signal in SPI SW mode - generate the nCS signals yourself (via toggling GPIOs). Works fine (I use it).
Bear in mind: you can (should) use nSS (nCS) in SW mode: you cannot use the intended SPI nSS HW signal in HW mode (it would toggle all the time with a new SPI transaction). All nCS signals are now a GPIO signal. You can use the intended GPIO (pin) for nSS also in GPIO mode: just make sure you do not configure all the nSS signal as SPI nSS signal (instead as a GPIO).