Shop OBEX P1 Docs P2 Docs Learn Events
Multiple SX48's communication — Parallax Forums

Multiple SX48's communication

AmitAmit Posts: 27
edited 2006-09-14 23:35 in General Discussion
I have multiple SX48's connected together and they need to communicate with each other. There is a common 4 line bus running between RA.0-RA.3 on each SX. I was hoping to set up synchronous communication between the chips similar to that done by the shiftin/shiftout commands. The problem is that both those commands configure the clock line to output mode. How can I set this up so that reading SX reads the data line based on the clock pulse provided by the writing SX.

Also is there limiting factor on the number of SX's that can hooked up in this manner. I couldn't find the numbers on it, but I'd imagine that the current required to drive an input pin high would be under 1mA. Since the SX can source 45mA per pin there shouldn't be any problem driving 10-15 SX's... correct?

Thanks a lot!
-Amit

Comments

  • cbmeekscbmeeks Posts: 634
    edited 2006-09-14 13:40
    Could you not make all RA.0 sending and all RA.1 receiving? That way you would only need two lines. Then just hook RA.0 to RA.1 on each system. Basically one line always sends and the other always receives.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Coders' Hangout
    A place for programmers to hangout!
    http://www.codershangout.com

    METROID?
    Metroid Classic
  • pjvpjv Posts: 1,903
    edited 2006-09-14 15:07
    Hi Amit;

    You can communicate synchronously with many (probably more than 256) SXes over a single line common to all units.

    I have done this many times with 17 SXes, at speeds of 10 Megabits/second. The trick here is to synchronize, all SXes, and then keep them synchronized. This is a little tricky but works very reliably when you get it all together.

    Cheers,

    Peter (pjv)
  • AmitAmit Posts: 27
    edited 2006-09-14 15:14
    So my set up has all the RA.0's on each SX hooked together, all the RA.1's on each SX hook together ... down to RA.3. So RA.0 is not connected to RA.1. I was presently thinking of using RA.2 as a flow control/ Ready to receive indicator line so then maybe I could use asynchronous comm. But in any case I was wondering if anyone has any experience making an SX read data based on an external clock signal. I'm not that good programming in assembly so I was trying to keep it in basic.
  • AmitAmit Posts: 27
    edited 2006-09-14 15:20
    Hey PJV,

    Thanks for the info. Do you have any tips on how to do it? What was your setup to keep them synced? Any help you could provide would be greatly appreciated!

    Thanks a lot!

    -Amit
  • pjvpjv Posts: 1,903
    edited 2006-09-14 23:35
    Hi Amit;

    Unfortunately this is not a trivial subject, and I don't have much time to donate just now. I've spent over a year getting the results right, so I can't just do this with some "pointers".

    Possibly if you were an accomplished assembler programmer; knew the nuances of the SX interrupt inside-out, and had a good multi channel oscilloscope on hand, then I might be inclined to have a go at helping. If this is the situation, please let me know, otherwise, I fear I will be pulling you along all the way, and that will take more time than I care to invest.

    My reason for posting my results on this were mainly to let you know that it CAN be done, and if you perservere, you CAN also figure it out.

    Cheers,

    Peter (pjv)
Sign In or Register to comment.