SPI Multi-Master

Hi All, I have an application that requires two SPI masters controlling one slave device. Has anyone creating working hardware for this situation. I have drawn up something involving diodes but have no idea whether it would work.

Thanks

Rich

Reply to
rich
Loading thread data ...

Rich, Are they the only three devices on the bus? If so, I would have each master check the select line to see if it is busy, and if so, wait...

charlie

Reply to
Charlie E.

Charlie, Yes there are three devices, two masters and one slave. I am not sure what you mean by "select line". Neither of the masters are microcontrollers so I have no way to manipulate the GPIO impedance etc. What I need is a way to electrically isolate the MOSI's and MISOs from each other. I cannot have to outputs tied together as that gives you bus contention. I have thought of putting series diodes on the MISOs, MOSIs, and the CS lines. I am not sure it this will screw up the logic levels.

Rich

Reply to
rsoenn

Rather then resolving all kinds of hardware and protocol complexities, set one of the masters as a slave and let the other master to control the bus. Provide some signaling between the "master master" and "slave master" so they can negotiate when necessary.

Vladimir Vassilevsky DSP and Mixed Signal Design Consultant

formatting link

Reply to
Vladimir Vassilevsky

Thanks Vladimir, That makes a lot more sense and I think I can set one device to be slave. Therefore I can tie MISO, MOSI, and CLK together.

The only remaining issue is the SS line. One device is always a slave, one device is a master but can be set to a slave when it is not being used, and the third will be a master or not present (unplugged).

So if I tie the SS lines together I can have a master talking to the slave but also to the slave that is only a slave because it is not used as a master at the moment.

How's that for confusing?

Rich

Reply to
rsoenn

Hi Rich, Ok, not sure what you are doing, but SPI is basically four (or more) lines. There is clock, data in and data out that are shared between all devices, and then each device has a SS (slave select) that activate that particular device to accept data. If you have two masters, then you could use that select line to know when the bus is active, but if your master devices aren't programmable (What are they?) then you have a problem. If you make one of the masters a slave, it then needs its own separate select line from the master.

I suspect I am missing something here... ;-)

Charlie

Reply to
Charlie E.

Hi Charlie, yes, there are twists to this project. One master is sometimes absent (physically removed) and the other can only be programmed through an RF interface. Sometimes the power comes from one masters side, sometimes from the RF! It is a weird one.

Rich

Reply to
rsoenn

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.