Shop OBEX P1 Docs P2 Docs Learn Events
Time captured from NMEA GPS RMC string — Parallax Forums

Time captured from NMEA GPS RMC string

teckertecker Posts: 7
edited 2010-10-21 14:37 in Accessories
In debugging my BS2 NMEA capture code I have noticed that the NMEA time takes 18 bits to store. I am trying to capture the string using WAIT and SKIP commands and it is working great except for the time is wrong. We would like to have the time working so that when we pull up the data we can see exactly when we captured the data. Is there any way to capture the 18 bits correctly?

Below is an example:
Time as expected: 202751 (20::27:51)
Binary encoding: 11 0001 0111 1111 1111

Code to capture this time:
gpstime VAR Word

SERIN GPS, GPSBaud, 4000, No_Response,[WAIT("RMC,"),DEC gpstime,SKIP 1,ioByte]

'this code captures the time and validity of the GPS Signal
'good for seeing if we are ready to log and have satellites locked in place

Binary captured: XX 0001 0111 1111 1111
Time as logged: 6143

Any thoughts on how to get the time to be fully captured?

Comments

  • TumblerTumbler Posts: 323
    edited 2010-10-19 19:10
    Try this:
    ...[WAIT("RMC,"),DEC2 hrs, DEC2 mins, DEC2 secs,...
  • teckertecker Posts: 7
    edited 2010-10-21 14:37
    Ah. That might work. I was to focused on catching the whole thing at once.

    I might need to see if I have enough ram. My memory is just about full. I will see what I can do.
Sign In or Register to comment.