GPS NMEA Checksum calculation and checking?
Thierry Donze
Posts: 4
The analyse of the quality and validity of NMEA sentence from GPS is mostly base on the checksum, and in one application, I need to verify it.
I have use the Xor (^) calculation of all the characters between $ and *, but excluding them, but I do not find the same value than the one given by the GPS.
Here is the principe of my calculation with a 15 characters NMEA sentence: $HCHDM,274.7,,,,*44
chk············ VAR···· Byte
chk=0
FOR i=1 TO 15
··· READ i, char····················· ' Get next character
··· idx = idx + 1······················ ' Point to next location
····chk=chk ^ char
··· DEBUG char
· NEXT
DEBUG HEX chk,CR
Does any body experience this checking before and can help me?
Thanks and Regards
Thierry
I have use the Xor (^) calculation of all the characters between $ and *, but excluding them, but I do not find the same value than the one given by the GPS.
Here is the principe of my calculation with a 15 characters NMEA sentence: $HCHDM,274.7,,,,*44
chk············ VAR···· Byte
chk=0
FOR i=1 TO 15
··· READ i, char····················· ' Get next character
··· idx = idx + 1······················ ' Point to next location
····chk=chk ^ char
··· DEBUG char
· NEXT
DEBUG HEX chk,CR
Does any body experience this checking before and can help me?
Thanks and Regards
Thierry
Comments
What about the commas, I can't believe they should be included, but to be honest, I've never done GPS checksum before?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
regards
++
FOR i=1 TO 15
instead of
FOR i=0 TO 15 ?