SPI devices in parallel.


Closed Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default SPI devices in parallel.

    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.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521

    Default Re: SPI devices in parallel.

    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.

  3. #3
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Re: SPI devices in parallel.

    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?

  4. #4
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305

    Default Re: SPI devices in parallel.

    I'm not an engineer and I've no experience doing this but according to http://www.mouser.com/ds/2/256/MAX54...5401-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.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521

    Default Re: SPI devices in parallel.

    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.

  6. #6
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Re: SPI devices in parallel.

    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$.

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521

    Default Re: SPI devices in parallel.

    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.

  8. #8
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Re: SPI devices in parallel.

    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/...n73/fn7307.pdf

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521

    Default Re: SPI devices in parallel.

    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:
    Name:  DS9637-38.JPG
Views: 1157
Size:  33.2 KB

    /Henrik.

  10. #10
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305

    Default Re: SPI devices in parallel.

    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.

  11. #11
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Re: SPI devices in parallel.

    Dont worry about it.

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

  12. #12
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Re: SPI devices in parallel.

    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.

Similar Threads

  1. question about the pin to pin connections on a SPI interface
    By wdmagic in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th January 2013, 13:03
  2. Need to use SPI but I'm already using the SPI port
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th December 2012, 09:52
  3. USB devices
    By MKtiger in forum USB
    Replies: 1
    Last Post: - 2nd November 2008, 10:23
  4. problems with parallel LCD
    By Brown in forum mel PIC BASIC
    Replies: 11
    Last Post: - 12th June 2008, 04:37
  5. Parallel LCD to Serial LCD
    By Mostafa in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th June 2007, 21:14

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts