PDA

View Full Version : help with error checking GPS data over audio link



MUC
- 20th February 2005, 16:43
I am sending GPS data over an audio link using a modem ic. On the TX side I have broken down the GPS data and I’m sending just the speed, heading and altitude. If it matters, I’m dropping the decimal numbers and only working with whole numbers to make things easier to convert later. My problem is that the wireless link is not the best and the data gets corrupted at times. What I’m doing is sending the speed, heading and altitude three times to the RX unit then I want to compare them against each other. Since my GPS updates every 2 seconds there are no issues with timing. I am successfully sending the data to the RX unit then outputting to the PC now. I just don’t know the best way to compare the data or the best format to send it. Eventually my plan is to send it to a LCD not a PC. At this time the program consists of three serin2 (1200bps) lines, one for each $1, $2, and $3; then three serout2 (4800bps) commands to view the data. It would be great if I could compare the speed, heading and altitude individually rather than the whole line. I don’t mind if I drop a couple of updates here and there I just don’t want to display garbage on the screen. Any help would be greatly appreciated.

Best regards,
Mark


Here is the format it is sent/received in. I am planning to change the 1,2,3 to A,B,C;

$1,speed,heading,altitude
$2,speed,heading,altitude
$3,speed,heading,altitude


Here is a snippet of some actual data transmitted to the receive unit and output to the PC. As you can see it makes it through 2 out of 3 times most of the time.;

$1,2,351,334
$2,2,351,334
$3,2,¦Sbššâj

$1,2<357,334
$2,2,357,334
$3,2,357,334

w¿ñ$1,2,355,¦&SHø
$2,2,355,334
$3,2,355,334

ÿ$1,1,353,333
$2,1,353,333
$3,1,353,333

$1,1,35Miššj
$2,1,355,333
$3,1,355,333

$1,1,11–¦&¦Hø
$2,1,11,332
$3,1,11,332

ø$1.1,29,332
$2,1,29*332
$3,1,29,33-
ã

MUC
- 21st February 2005, 20:03
I need to create a checksum to send with my data over my wireless link. I have three to five string variables to send. I will not know the length of the strings as they will always be changing. Can I just add the strings and save the result as a word or byte? For example;

spd var byte
deg var byte
alt var byte
cs var word

‘serin2 my data as string variables
cs = spd + deg + alt
serout2 Pinout,baudout,["$A,",str spd,",",str deg,",",str alt,"*",cs,"*",13,10]


Will this work? If anyone has the knowledge to do this please help. If I'm way off base please let me know. This checksum thing has got me stumped. I’m new to programming and don’t know how to proceed.

Thanks,
Mark

mister_e
- 21st February 2005, 20:23
serout2 Pinout,baudout,Mode,["$A,",#spd,",",#deg,",",#alt,"*",#cs,"*",13,10]