Shop OBEX P1 Docs P2 Docs Learn Events
commutation between 2 sx chips — Parallax Forums

commutation between 2 sx chips

Travis BestTravis Best Posts: 8
edited 2007-08-01 17:05 in General Discussion
I am new to the whole sx thing and really haven't done much programing like this before so any help is greatly appreciated but anyhow what is the best way to pass a 2 digit value between 2 sx chips 1 chip needs to send the data and the other need to receive they dont need to pass it back and forth I need to be able to do this using as little code and the least amount of pins possible thanks for any help

Comments

  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-08-01 15:58
    Sending data serially is probably the most straightforward and common approach. If you do this asynchronously (such as with the SX/B SerIn and SerOut commands) you can send values in one direction with a single signal wire and a ground connection.

    If the chips are located far apart from each other you may want to use additional hardware to compensate for signal loss and noise.

    - Sparks
  • Travis BestTravis Best Posts: 8
    edited 2007-08-01 16:20
    is the serial out command affected if i am running a interrupt
  • BeanBean Posts: 8,129
    edited 2007-08-01 16:25
    Yes, an interrupt will affect the serial commands. I like the D-BUS protocol. It uses 2 pins and is not affected by the speed of either the sender or the receiver. It's not affected by interrupts either.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Teacher: What is the difference between ignorance and apathy ?
    Student: I don't know and I don't care
    Teacher: Correct !
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • Travis BestTravis Best Posts: 8
    edited 2007-08-01 16:52
    and good example anywhere on the dbus protocol using sx/b?
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-01 17:05
    Keep in mind that it's not that difficult to do ISR-driven serial with the SX; and SX/B allows one to easily mix assembly and BASIC so the overall programming chore is simplified.

    I've attached a framework to get you started; it allows for half-duplex, ISR-driven serial on a single pin and will work from 1200 to 38.4K baud -- it uses Open True mode so you need to put a pull-up (don't use the internal pull-up) on the serial I/O pin.
Sign In or Register to comment.