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

How to interact with Multiple slaves on SPI having different clock speeds

Hi, I want to connect 3 SPI slaves on the same SPI bus, But all slaves are working at different Clock frequencies and frame structures. What will be efficient way to communicate through SPI?

  • You can send to multiple slaves at the same time, as long as no more than a single slave activates the MISO signal. The slaves just has a maximum clock rate they may support. So it's enough that the master makes sure that the clock frequency isn't higher than what the slowest slave can support - and that the clock signal symmetry also fulfills the requirements of all slaves.

    If the different slaves receives data using different protocols, then you'll have to enable them one by one when sending data to them. The slaves that doesn't see a SSEL (Slave Select) will ignore anything that happens on the MOSI signal line, and they will also stay away from driving the MISO signal line.

  • Thanks Per! I got your point and it sound good also.

    But if in case one slave have data frame size of 8 bit and other two are having of 16 bit, in that case do we need to select and communicate one by one or there is some alternate approach.

  • If one slave has 8-bit and one have 16-bit, then it's likely that there are no messages that are meaningful to send to them both.

    Unless the data is actually laid out as 16-bit vales while one slave can't be configured for anything wider than 8 bits, so you need to do two 8-bit transfers (while keeping the slave select active) just to form 16 bits.

    Note that the slaves often doesn't see any time during a transfer, so they don't care much about # of bits configured, except that they split and present read data based on the configured width, and they expect the total message to be n times the number of bits. So you can't configure an SPI device for 15 bits and then send 16 bits without problems - that extra bit will be shifted in as start of one more words unless a reset can clear the