Shop OBEX P1 Docs P2 Docs Learn Events
Serial Communications for a wireless system — Parallax Forums

Serial Communications for a wireless system

Dave ADave A Posts: 31
edited 2006-12-20 22:38 in BASIC Stamp
I would appreciate if somebody could give me an example of code that would work with a serial string and wireless technology. The current code I am using does not cure random problems. (SEROUT 0, 16468 , [noparse][[/noparse]"X","Y","Z",PAN,TILT,SHUTTER,ZOOMIN,ZOOMOUT])· I am using a Linx Transmitter and reciever set.· They recomend some kind of Cyclic Redundancy Check code.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-20 22:06
    Have you got a link to the Linx documentation?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-20 22:16
    Dave,
    ·
    ·· If the RF Modules don’t have their own checksum hardware (most do not) then you have to handle data integrity checking in software.· This could involve generating a checksum for the data you are sending and then, on the receiving end calculating one for what you receive and comparing it to the received checksum.· If there is a problem you respond to the sender with a NAK instead of an ACK.· Something to let the sender know you received bad data.· If transmission is one way you simply ignore the packet and wait for a good one.· In such a system the packets usually come more frequently.· I hope this helps.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-12-20 22:38
    You can send another byte with the following:
    SEROUT 0, 16468 , [noparse][[/noparse]"X","Y","Z",PAN,TILT,SHUTTER,ZOOMIN,ZOOMOUT,PAN+TILT+SHUTTER+ZOOMIN+ZOOMOUT]

    When you receive the data, add them back together and check to see if it matches the last byte (the sum of all of them). If yes, then use, if no, reject it and wait for then next transmission.

    Also, you can check out XBee RF transcievers and carrier boards ( http://www.selmaware.com/appbee ) for glitch free transmissions since they use a high level protocol similar to what Chris described, but it's built into the module protocols.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
Sign In or Register to comment.