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
In that case, if I want to control multiple slaves, does it mean I need to set the slaves to software mode, use the external NSS pin as a regular GPIO pin, and change the SSI bit according to what I read from the external NSS pin?
Sorry, I am quite confused after reading the reference manual because of the different possibilities that the NSS pin can be used.
Hi,
I have done this for 2 LCDs on one SPI port.
It works like a dream except the SPI port itself seems to make the processor run hot. So i added a 47R in series with the MOSI and the CLK pins. 10MHz no issues, 100cm cable, still worked.
Do you still need help ?
All slaves will leave the SPI MOSI pin high for Idle. The pin only drops to send a 0. Slaves only respond to requests. As long as you only have one request on the bus then only one slave will respond.
You need a pullup on the processor MISO pin then you need a diode for each channel slave MISO.
as any slave drops the MISO pin to zero volts, the diode will conduct and the processor MISO pin will go low. No other pin will be affected.
:)