Calculating NMEA checksum
Bstamp_gps
Posts: 9
Has anyone calculated the NMEA checksum with Basic Stamp?
In fact,·I receive the NMEA data·(which is done), do some·modifications·(which is done), recalculate the checksum·(which is not yet done)·and retransmit on another port·(done).
I have searched for the procedure to do this calculation on the internet - however, with no success.
Would much appreciate any assistance.· Thanks for any help ...
·
In fact,·I receive the NMEA data·(which is done), do some·modifications·(which is done), recalculate the checksum·(which is not yet done)·and retransmit on another port·(done).
I have searched for the procedure to do this calculation on the internet - however, with no success.
Would much appreciate any assistance.· Thanks for any help ...
·
Comments
Post edit --
http://www.codepedia.com/1/Calculating+and+Validating+NMEA+Checksums
Post Edited (PJ Allen) : 6/16/2006 7:28:58 PM GMT
I've looked at that website. However, what I need to know is how can we do this with Basic Stamp?
Thanks.
The character G has an ascii value of $47,· % 0100 0111
The character P has an ascii value of $50,· % 0101 0000
The character R has an ascii value of $52,· % 0101 0010
^ is the operator for bitwise XOR
chksum = 0100 0111 ^ 0101 0000····· ' G xor P
(this results chksum = 0001 0111)
chksum = chksum ^ 0101 0010········ ' (G xor P) xor R
(this results chksum = 0100 0101)
So, you convert your ascii characters to their byte/numeric equivalent and start your checksum DO... LOOP (FOR... NEXT, whatever you like) process (re. above)
Y/N ?
PS -- Remember to XOR the commas, too.
Many thanks for your time ~