PDA

View Full Version : SPI devices in parallel.



jmgelba
- 4th March 2013, 23:23
I have a situation where I need to control between 50 and 100 digital pots at the same time. Well, within 5uS of each other.

Can I parallel all of them as to enable CS for all of them at the same and send the data once? The cable lengths from controlling PIC to first pot start at a few feet away and the last pot could be as far as 50ft away.

Thanks.

HenrikOlsson
- 5th March 2013, 06:16
I'd say yes - in theory.
In practice the PIC output may not be able to drive the long cable and all the inputs so you may need a proper driver and possibly a buffer somewhere along the way - for both the MOSI and CLK pins. If the speed is high and the environment noisy you may want to use a differential driver and a couple of receiver along the length, then fanning out to a couple of chips with short length from each receiver. I think you need to experiment with it.

/Henrik.

jmgelba
- 5th March 2013, 14:08
In doing a bit more research it looks like trying SPI is doing it the hard way. I2C is a better choice, with Can being the best choice. I havent designed any pcb's yet so this is open, however I do have a working spi controller with spi digital pot working in a different project and I wanted to reuse the code, layout and experience on this new project.
The question again then is, can you sent data to every device on the I2C bus at once?

AvionicsMaster1
- 5th March 2013, 15:16
I'm not an engineer and I've no experience doing this but according to http://www.mouser.com/ds/2/256/MAX5400-MAX5401-88419.pdf .7uA is the supply current for the chip. It's the first part I found in mouser is it's only signifigance.

The way I see it, if the CS line requires that full current, I know it doesn't, you could put over 28,571 devices on one line. Any wire visible to the naked eye should be able to carry .7uA @ 5VDC, or 700uA for 1000 chips. I think, PICs are supposed to source, or is it sink, up to 20mA per pin and 25mA per device. If power is a concern you could drive a transistor or FET to power the CS line.

I'm not too concerned about a wire length of 50 feet as long as you use something around a 26 or larger gauge wire.

Let us know if you do it and it works.

HenrikOlsson
- 5th March 2013, 15:54
How did you know that's the chip being used?
Anyway, the actual input current isn't really the problem. It's the capacitance and inductance added to the circuit BY each input and the fairly long cable.
On the CS-line it might not matter because you can allow the voltage a couple of micro seconds to rise and fall but on the CLK and DATA pins it could when the clock frequency of the bus goes up (the chip you linked to is capable of 10MHz clock - not that you have to drive it that fast though).

The output driver in the PIC will have to charge and discharge the capacitance presented to it by all the inputs and the long cable.

By adding a line driver capable of sinking and sourcing more current than a PIC I/O to the CLK and DATA line the capacitance in the "external circuit" can be charged and discharged faster making the signals "cleaner". It will also add some protection.

All I'm saying is that it might not work to simply slap 50ft of cable on the outputs and then 50-100 chips along the length of that cable.

/Henrik.

jmgelba
- 5th March 2013, 16:07
I agree with Henrik. Capacitance is the enemy here. Noise is also a problem - a 50ft caable makes for a nice antena when running around 50+ dc/dc power supplies. Clock and data speeds are low as its only one byte every so often. This is just for dimming control set via push buttons on the master PIC.

Unfortunately due to the cost of each assembly, I cant just build a few and test to see if it works. Each assembly where the pot will be located is several hundred US$.

HenrikOlsson
- 5th March 2013, 16:45
In that case, what difference does the cost of a dual (or two single) differential receiver(s) on each board make? Probably around a buck or two.
If the boards are already designed and ready for production and you can't spin it again then you perhaps you could fit the receiver circuitry inside the connector housing used to for the communication lines (or is it screwterminals?).

/Henrik.

jmgelba
- 5th March 2013, 18:25
EL5371 driver and EL5372 receiver should do the trick? I have never done anything with data transmission over cables before. I assume I would need a driver on each of the dc/dc pcb's too? So it would go:

Master-driver --> cable --> DC/DCreceiver-driver --> cable --> DC/DCreceiver-driver --> cable --> DC/DCreceiver-driver .....

http://www.intersil.com/content/dam/Intersil/documents/fn73/fn7307.pdf

HenrikOlsson
- 5th March 2013, 20:30
Nah, I don't think those are suitable, they look more like differential analog drivers - not really what you want.

I was thinking more on line of a DS9638 on the master and a DS9637 (or similar devices) on each of the slaves:
6874

/Henrik.

AvionicsMaster1
- 6th March 2013, 02:32
Terribly sorry. I assumed most digital pots CS line requirements would be the same. The question wasn't about power supply it was about control and I again assumed that any pot chip would work about the same. Obviously bad assumptions on my part though I assumed a worst case scenario and replied on that.

I stated I wasn't an engineer and had no experience but I assumed a shield on the CS line and if necessary the power supply lines. He could also use a twisted pair on the power supply which should reduce noise collection.

I again assumed that a small conductor cable wouldn't create a great capacitor and with the slowish switching speed I assumed that wouldn't be a problem.

So now I've been straightened out and I apologize for leading anyone astray. Please let us know how you proceed and more importantly, your solution.

jmgelba
- 9th March 2013, 17:21
Dont worry about it.

I'm going to try the drivers and will be using standard cat5 cable and connectors. Makes things really easy.

jmgelba
- 11th March 2013, 04:35
Just a thought, connect a 1K resistor to the output of each receiver and connect the other end of the resistor to the base of a 3904 transistor, I think I should be able to turn on an LED each time the line goes high without loading it. It would be really nice to have a simple led showing activity on the data lines at each light, as a cable and connector diagnostic.