This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

About STM32 SPI multi slave setup

Hi, I am trying to construct a SPI network with STM32F1 MCU in a star-shaped network so that all slaves are connected directly to the master.

In a one-master-one-slave situation, it seems that the slave is usually set to software mode so that SSI=0. Since NSS will always be pulled down there is not much problem.

However, I have read from the reference manual that the SSI bit will replace what the NSS pin is receiving if I use software mode. So, if I use software mode for all the slaves, does it mean all the slaves will be "pulled down"? In that case, should I use hardware mode for a multi-slave setup, so that I can control which slave to talk to using GPIO pins from the master?

Thanks in advance

Parents
  • As each SPI peripheral on the STM32 only has a single chip select associated with it, I'd think the "hardware" mode would be a bit constraining in your case.

    People generally avoid the "hardware" mode in the STM32 because it is unduly awkward to handle the expectations of most SPI slaves you might attach. Using a GPIO allows for the flexibility to work with real devices. If the hardware requires micro-management, do it on your terms, not its.

Reply
  • As each SPI peripheral on the STM32 only has a single chip select associated with it, I'd think the "hardware" mode would be a bit constraining in your case.

    People generally avoid the "hardware" mode in the STM32 because it is unduly awkward to handle the expectations of most SPI slaves you might attach. Using a GPIO allows for the flexibility to work with real devices. If the hardware requires micro-management, do it on your terms, not its.

Children