Go Down

Topic: SPI multi master (Read 3 times) previous topic - next topic


Hello Arduino friends!

I am working on a project that requires multiple masters to send their data to one slave on a shared bus.
Since speed is an issue I need to use SPI and not I2C / TWI etc.

The big question now is how to properly synchronize the masters so only one is sending data at a time.

Since there is only one central slave I don't really need the SS line. Would it be possible to connect all the SS lines of the masters and use it as a "busy" line?
I.e. if a master wants to send data he first checks the SS line if it's busy, if not he sets it to busy, sends his data and then resets the line.
Would this be possible or would we face possible race condition problems here?

What about SCLK, how could I ensure the right CLK signal arrives at the slave?

And last but not least, how can I prevent a master from "starving" i.e. he wants to send data but the line is always busy?

Thanks a lot in advance for any ideas, I appreciate the help very much!
Have a nice day! :)


The big question now is how to properly synchronize the masters

That is indeed the big question.

I can't think of a simple way to do this straight away.

What is the slave device? Smart or dumb? And how much data does it need?

Rob Gray aka the GRAYnomad www.robgray.com


Slave device is a microcontroller but data transfer has to be initiated by the master devices (i.e. no polling by the slave).

There is a lot of data to process, the combined dataflow from all the masters will probably be around 1 Mb/s.

Now you see why I'm having a problem ;)


OK, what is the nature of the data, are the masters reading sensors and the slave has to consolidate the readings or something.

Would all masters normally have data to send?

Also, what is the slave going to do with all this data? I gather it's not an Arduino.

Rob Gray aka the GRAYnomad www.robgray.com


Exactly, the masters sample large sensor arrays at a high rate and the slave has to gather all this data at a central place to either forward it to a PC or if it has sufficient resources left process the data first and then send the results to a PC.

The slave hasn't been implemented yet, so there hasn't been a decision on what microprocessor it will be.

Go Up