Shop OBEX P1 Docs P2 Docs Learn Events
GPS PMB-648 checksums don't make sense — Parallax Forums

GPS PMB-648 checksums don't make sense

rldarrahrldarrah Posts: 1
edited 2012-09-03 23:45 in Accessories
I'm using a PMB-648 with an Arduino Mega ADK. My simple project runs the yellow wire (TTL TX) into Serial1 (RX1, pin 19). The GGA NMEA strings I'm getting seem mostly plausible, but the other strings are either not-received or somehow suspect. I've been working on verifying the checksum. However the checksum values in the GGA strings do not seem to be correct (the other sentences appear to have corrupted checksums).

My "inString" starts after the '$' so don't worry about why it's not shown below.

My computeChecksum function is:
// calculate the checksum of NMEAString (xor contents between the '$' and the '*')
unsigned char computeChecksum(char *inString, int len) {
  unsigned char computedChecksum = 0;
  
  Serial.println("Computing checksum for: ");
  Serial.println(inString);
  
  for (int i = 0; i < len; i++) {
    if (inString[i] == '*') {
      Serial.print("Computed checksum: "); Serial.println(computedChecksum,HEX);  
      return computedChecksum;
    }
    else {
      computedChecksum ^= inString[i];
    }
  }
  Serial.println("Problem in computing checksum - no * found");
  return 0; 
}

Sample output #1 (except I doctored the lat/longs which were too correct to post):
Computing checksum for: 
GPGGA,063223.000,3907.7084,N,09404.0313,W,2,09,0.8,9.6,M,-34.2,.9313,W,0.00,186.79,040912,,,D*79
Computed checksum: 3F


Garbled other sentences:
$GPGSV,3,2,12,06,25,219,30,03,25,234,28,11,21,312,27,31,19,168,2
$GPRMC,043621.000,A,3907.7084,N,09404.0313,W,0.00,186.79,040912,

Yesterday I was getting GSV sentences 1&2 stuck together (with no checksum) and today I'm only getting this truncated sentence 3. RMC sentences come out for a couple of minutes after turning on the module, but then I stop getting them.

I double checked the expected checksum on this site:http://www.hhhh.org/wiml/proj/nmeaxor.html and got 3Fthere as well.

So what am I missing? Is it possible that characters are being dropped in the middle of the string and that's what the checksums don't line up? Or am I misunderstanding something in how to compute the expected checksum? Is it possible that all the outputs of my GPS are somehow corrupted (indicated by the strange behavior of the other sentences)? Do you have any recommendations for fixing this?
Sign In or Register to comment.