Shop OBEX P1 Docs P2 Docs Learn Events
Garmin NEMA Sentences — Parallax Forums

Garmin NEMA Sentences

musictechmusictech Posts: 54
edited 2005-03-25 19:11 in BASIC Stamp
I am trying to read the nema sentence information off of a Garmin GPS 18LVC reciever (www.garmin.com/manuals/GPS18_TechnicalSpecification.pdf). I am using a BS2. I have some sample code from an episode of Nuts and volts but it is designed for the BS2p, and one of the commands isn't compatible with the bs2 (spstr). I can pull data off the gps reciever but its garbled.

Can anyone help me with the parsing?

Thanks

Comments

  • ForrestForrest Posts: 1,341
    edited 2005-03-05 12:37
    There are 3 GPS programs written for the BS2 here groups.yahoo.com/group/basicstamps/files/
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-07 14:09
    I've posted this program a few times now ... I guess one more won't hurt; it should get you going.· Note: If you really have to use NEMA sentences, you can modify this program, but it will be very tough to get working well.· NEMA wants to be output at 4800 baud and that cuts down on the SERIN modifiers you can use.· By using the Garmin text output, the 2400 baud speed helps us and the fixed format makes parsing very simple.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • musictechmusictech Posts: 54
    edited 2005-03-08 05:49
    Mr. Williams, I found your programs and understand how they work. However, I am getting inaccurate information from my GPS device. I am using a Garmin 18LVC OEM GPS sensor. I tried the program that just gives me the time, but the time is wrong and changes randomly. I have also tried to get it to produce a string of numbers of code so I can see what strings are being outputted. Basically

    serin gpspin, 2400, no_gps, [noparse][[/noparse]wait"@", dec a, dec b, ..... , dec z]
    debug dec a, tab, dec b, tab, ...., tab, dec z, cr

    I get back a string of numbers, but nothing resembling the time. I have one other thing to check but kinda at a lost right now.
  • steve_bsteve_b Posts: 1,563
    edited 2005-03-08 12:10
    Investigate the STR modifier.· It would let fill an array with serial data and you'd be able to output that.

    The data you are getting....is there 'garbage' in there or are they all readable values!?

    You might not be getting fixed fields....so, it would drop the LSB 0's when they're there....so what was once a 5digit value would become a 4digit value.· So, by grabbing each individual character and then outputting the variables associated with where they were....then when you lose this digit your pointers all move up....I'm babbling lol!!

    You do need to understand what your data looks like....the NMEA 0183 setting on your GPS would give you values separated by comma's.

    So you could then do the

    serin gpspin, 2400, no_gps, [noparse][[/noparse]wait"@", data1, skip ",", data2, "skip ","...etc...]· somehting like that anyhow!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://ca.geocities.com/steve.brady@rogers.com/index.html
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-08 14:15
    Well, what you probably need to do is route your GPS output to a generic terminal program so that you can see what's actually coming out -- the data stream may not be what you're expecting.· Even though·I had specs for the Garmin text output, I did this as an exercise and found it helpful.
    musictech said...
    Mr. Williams, I found your programs and understand how they work. However, I am getting inaccurate information from my GPS device. I am using a Garmin 18LVC OEM GPS sensor. I tried the program that just gives me the time, but the time is wrong and changes randomly. I have also tried to get it to produce a string of numbers of code so I can see what strings are being outputted. Basically

    serin gpspin, 2400, no_gps, [noparse][[/noparse]wait"@", dec a, dec b, ..... , dec z]
    debug dec a, tab, dec b, tab, ...., tab, dec z, cr

    I get back a string of numbers, but nothing resembling the time. I have one other thing to check but kinda at a lost right now.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-08 16:16
    musictech -

    Based on the information I found elsewhere on the web, the Garmin GPS 18LVC apparently is set to output the NMEA sentence data at 4800 baud, not 2400 baud as you have indicated in your SERIN command, as a default setting from the factory. You can either change the defaut baud rate using the Garmin GPS Configuration Program that should have come with the unit, or with a terminal program like Windows Hyperterminal.

    If you haven't changed the default baud rate, this may be the entire problem, as the data coming out WILL look like garbage.

    Regards,

    Bruce Bates
  • cbtruettcbtruett Posts: 2
    edited 2005-03-25 15:02
    were you able to make some sense of the gps data? i had the same problem with the bs2p code. i tried some other sample code but it wasn't exactly what i needed and i haven't been able to modify it correctly.

    thanks a lot
  • Tom WalkerTom Walker Posts: 509
    edited 2005-03-25 19:11
    musictech,
    Was the snippet you offered in a pseudo-code? If not, then you might not realize that "2400" as a baudrate parameter will not give you 2400 baud. Check the help file for the proper baudrate value for your Stamp model. Or better yet, include Jon's conditional template into your code to make things so much easier (not to mention neater).

    HTH

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Truly Understand the Fundamentals and the Path will be so much easier...
Sign In or Register to comment.