Serial Communications for a wireless system
Dave A
Posts: 31
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
·
·· 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
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·