Shop OBEX P1 Docs P2 Docs Learn Events
decoding NEMA 0183 — Parallax Forums

decoding NEMA 0183

Macgman2000Macgman2000 Posts: 59
edited 2005-05-16 02:27 in General Discussion
Hello All,

I hacked an old·"hockey puck" GPS using 4800bps 8N1, ASCII format. It's an old TravRoute serial GPS·I got for free. I want to decode the current position data stream and display on an LCD. Is there any sample code for doing that? or any help will be appreciated.

Best Regards,
Nick
·

Comments

  • David BDavid B Posts: 592
    edited 2005-05-12 18:19
    Are you planning to use assembly or basic? There is an entry in the projects forum where a BS2 processes GPS data for a model rocket project - have you seen that?
  • JonbJonb Posts: 146
    edited 2005-05-12 18:59
    NMEA is quite simple to decode with a basic stamp. Jon Williams has some code which is widely used to accomplish this task. I suggest doing a search for NMEA.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 5/13/2005 4:22:20 AM GMT
  • Macgman2000Macgman2000 Posts: 59
    edited 2005-05-12 20:14
    I was hoping to use Basic language. I have not seen the post regarding the BS2....I will look for it.

    Thanks!!!

    Best Regards,
    Nick·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-12 20:19
    Check our "Nuts & Volts" reprints -- I've done a couple articles on BASIC Stamps and GPS; one does decode NEMA 0183 strings. It would take a little bit of work, but it could be ported to SX/B.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Macgman2000Macgman2000 Posts: 59
    edited 2005-05-13 17:53
    Hello Jon,

    Can the·Serin command·loop on a qualifier. Ex,·wait to see $GPGAA then start·counting off commas until you get to the byte of interest?



    Best Regards,

    Nick
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-13 20:14
    What you'll want to do is put SERIN into a subroutine (so that it only compiles once), then you can do something like this:

    Wait_For_GPGAA:
    · RXBYTE @serByte
    · IF serByte <> "$" THEN Wait_For_GPRMC
    · RXBYTE @serByte
    · IF serByte <> "G" THEN Wait_For_GPRMC
    · RXBYTE @serByte
    · IF serByte <> "P" THEN Wait_For_GPRMC
    · RXBYTE @serByte
    · IF serByte <> "G" THEN Wait_For_GPRMC
    · RXBYTE @serByte
    · IF serByte <> "A" THEN Wait_For_GPRMC
    · RXBYTE @serByte
    · IF serByte <> "A" THEN Wait_For_GPRMC

    ·After that you can put the RXBYTE call into a loop to skip over as many characters as you need to skip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Macgman2000Macgman2000 Posts: 59
    edited 2005-05-13 22:50
    Hello Jon,

    I guess I am not up on all the coding tricks. I can't see how it all works. Let me see if I understand, set up SERIN in a subroutine that is polled? Then go to WAIT_FOR_$GPGAA? Is there a tutorial I can reference, I am not familiar with this coding method. I guess I have been using PicBasic Pro for too long and stuck on that type of coding.



    Best Regards,

    Nick
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-13 23:04
    Your best refence is the online help file. The January issue of Nuts & Volts has a SX/B project in my column that uses the strategy outlined above -- it should help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Macgman2000Macgman2000 Posts: 59
    edited 2005-05-14 03:13
    Hello Jon,

    I read the Jan edition and reviewed the SX/B help section regarding SERIN. I was able to get my GPS to work.·I compared the data·on my LCD with·a magellen handheld and it checks out.

    Thanks for your help!!!!

    Best Regards,
    Nick
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-16 02:27
    Excellent! I'm pleased to hear it -- perhaps you could share your code and project schematic in the Projects forum; I'm sure it would be of interest to many forum members.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.