Shop OBEX P1 Docs P2 Docs Learn Events
Checksum Help? — Parallax Forums

Checksum Help?

autobus83autobus83 Posts: 6
edited 2008-03-24 02:09 in BASIC Stamp
I am having problems getting my basic stamp to read the serial in from my Garmin GPS. I am trying to use the @ symbol as the checksum but when I put in any checksum into my code the program locks up. Here is my code I am trying to use.

Adam

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-16 23:56
    Why are you using "@" and what are you trying to do? How about a description of what you're trying to accomplish (with a little detail)?
    I know that the Parallax GPS uses "*" as the marker for the checksum. I think that's pretty standard.
  • autobus83autobus83 Posts: 6
    edited 2008-03-17 00:19
    All I am trying to do is get data from my Garmin Etrex GPS and debug it to the screen through the basic stamp. I am using the @ for the start bit. When I look at the data on a program that I have called viewport that shows the serial data from my gps on screen all of the lines start with the @ symbol. Isn't that the symbol I want to use as my start bit. Also when I put in anything as my startbit the program locks up on the serin line.

    Post Edited (autobus83) : 3/17/2008 12:24:37 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-17 01:57
    Here's a website with a description of the NMEA 0183 data that the Garmin uses: en.wikipedia.org/wiki/NMEA.
    As you can tell from that, the initial character of a data item is "$", not "@". Do make sure that you have the Baud mode
    constant correct for your GPS receiver. Check the SERIN chapter in the Parallax Basic Stamp Manual for the proper connections
    and the proper Baud mode constant. The Garmin receiver puts out RS232 signals and the Baud mode should be for inverted data.
  • autobus83autobus83 Posts: 6
    edited 2008-03-17 03:09
    I checked everything and this is what I have:

    SERIN 0, 16572, 2100, No_Data, [noparse][[/noparse]WAIT("$"),gpstime]

    16572 should be 4800 baud inverted. It is really jumpy and when it does show me the value of gps time it is a funky letter y,
    th kind you see when the baud is not set correctly.

    I checked and the baud on my gps is set to 4800.
  • phil kennyphil kenny Posts: 233
    edited 2008-03-17 03:24
    Try changing the baud rate to non inverted.

    The BS2 Stamp value is 188 for 4800 non inverted

    The Parallax receiver uses 4800 non baud inverted, as do most Garmin units.

    A good reference for GPS NEMA info is at www.gpsinformation.org/dale/nmea.htm

    phil

    Post Edited (phil kenny) : 3/17/2008 3:41:44 AM GMT
  • stamptrolstamptrol Posts: 1,731
    edited 2008-03-17 13:48
    Just until you get it going, try making your variable "gpstime" an array of several bytes (say 8 or 10) then change your SERIN to read in those 8 or 10 bytes after the "$".

    SERIN 0, 16572, 2100, No_Data, [noparse][[/noparse]WAIT("$"),STR gpstime\8]

    Use a DEBUG to see what was captured.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • autobus83autobus83 Posts: 6
    edited 2008-03-23 21:47
    I have tried every thing. I know my gps is outputting at 4800 baud, and I know the start character is the $ symbol. But when I run the program it doesn't get data every time and when it does get data is prints out funny characters like the baud rate is wrong, here is my code.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-03-24 02:09
    The $GPRMC sentence's time data is not one byte; it is 6 bytes: 2 for hours, 2 for minutes and 2 for seconds.· So, you need an array.

    It goes --·$GPRMC,hhmmss.sss, other stuff...
    If all you want is the hours, minutes, and seconds:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
     
    TM VAR Byte (6)   'hhmmss  ** array **
     
    Get_Time:
     SERIN 0, 16572, [noparse][[/noparse]WAIT("RMC,"),STR TM\6]
     DEBUG "The time is: ",STR TM\6, CR
     GOTO Get_Time
     
    

    Post Edit --·If 16572 doesn't work, try 188.· I don't know the details of your·Stamp-to-Garmin inter-connect.

    Post Edited (PJ Allen) : 3/24/2008 2:48:14 AM GMT
Sign In or Register to comment.