Shop OBEX P1 Docs P2 Docs Learn Events
Example Code to send/receive data between Basic STAMP and SX — Parallax Forums

Example Code to send/receive data between Basic STAMP and SX

John KauffmanJohn Kauffman Posts: 653
edited 2008-04-12 09:30 in General Discussion
I would like to do sensing & processing in SX/B and then have the data available for a project on a Basic STAMP.

I've had no luck searching the Parallax site, but surely someone has BS2 & SX/B code for this kinf of project.

The STAMP will send a request to the SX for a value (a dozen byte-size values are available in the SX variables)
The SX will send the byte value·back & the STAMP will store it in a variable.
The connecting cable is only 20 cm, so no distance worries.

Can anyone point me to an example? Thanks.

·

Comments

  • JonnyMacJonnyMac Posts: 9,216
    edited 2008-04-11 21:48
    John,

    I've attached a copy of our (EFX-TEK) firmware for the RC-4 relay board. It uses the Parallax AppMod protocol and communicates over single-wire serial. If you look at the code you can see that it can send and receive requests.

    If you SX must be doing something else while serial is coming in or going out then you'll have to use an interrupt and buffer the serial data. If you need, I can show you how we do that, too.
  • John KauffmanJohn Kauffman Posts: 653
    edited 2008-04-12 09:30
    Thanks. I've studied the code you posted & think I have isolated the pertinent parts.
    I am going to do a proof-of-concept with two STAMPs so I can use the screen debug tool.
    Then I'll switch back to SX.

    Goal is to get the simplest possible set of code so I (and others) can pick it up & customize.
Sign In or Register to comment.