2023-01-11 12:33 PM
I would like to connect 4 devices on two interfaces or 8 on one SPI bus and I would like to make sure that it will be working properly (given that parasitic capacitance will be small enough). I will be using STM32L496ZGT. I would like to ask also, what is your best way of handling multiple chips select signals (for eg. 8)? Is using demux a good idea?
2023-01-11 12:41 PM
A 3-to-8 or 4-to-16 type decoder, with an enable, or unconnected idle state would be how I might approach.
Watch that the SPI slave does actually disassociate from the bus when it's CS is HIGH.
Watch timing expectations.
2023-01-11 01:01 PM
Thank you very much for your reply. The decoder might be a better idea. I also have a few spare pins on MCU, so the decision lies in the efficiency of both solutions. Maybe do you know how industrial-grade solutions are sorted in such situations? Is simple better in this case?
2023-01-11 09:00 PM
If bus capacitance is out, it depends on the bus topology. As multi drop multi NSS, it should be ok. As daisy chained, the last slave will accumulate a MISO delay vs STM32 sck which will limit the max operating frequency. Otherwise, as most SPI have multiplr pins for easi SPI signals, you can create 2 buses with 1 HW SPI by dynamically changing alternate function from gpio to spi mode as it is time multiplexed.
Use chatGPT as first level instant support before waiting more in the forum, shall you need faster resolve for your issue.