I need to parse NMEA strings and I only have a single cog to do it. Ryan David has written code (search GPS NMEA Parser in the OBEX) which in theory should do it, but I can't get it to work. It's based off FullDuplexSerial. Has any one had success with this code? I'm trying to read data from a SkyTraq GPS module.
Instead of returning heading which should be some value between 0 and 360 degrees (or maybe 0 and 3600), it returns 808464432. Number of satellites, when first powering the GPS on should start at 0 and then go to a value of between 4 and 30. However, I'm getting a value starting at 12336 then increases to 12340 and 12341 (presumably 4 and 5 satellites).
I have verified the GPS module works with other code that I've used for years (GPS_Str_NMEA.spin v1.0 by I.Kövesdi which uses 3 cogs) so I know I have the GPS_Baud set up correctly. The parser probably wouldn't output any values if the GPS_Baud wasn't set up correctly since it is looking for the GGA and RMC NMEA string IDs before pulling data. I just don't understand why the numbers returned don't make sense. I have experimented with the four different modes and haven't had success there either:
'' mode bit 0 = invert rx
'' mode bit 1 = invert tx
'' mode bit 2 = open-drain/source tx
'' mode bit 3 = ignore tx echo on rx
I've also wondered if my NMEA sting from the GPS module has an extra byte added or removed. I have tried shifting the satellite bytes around in the parser. For instance, I have made them bytes g44 and g45 instead of g45 and g46. I've also shifted them the other direction by one byte. That didn't work either.
If anyone knows what the issue might be here or knows of a different GPS NMEA string parser that uses a single cog, please share. In the meantime I'll keep digging deeper.