Shop OBEX P1 Docs P2 Docs Learn Events
Garmin gps — Parallax Forums

Garmin gps

WalterWalter Posts: 17
edited 2005-07-04 20:01 in Robotics
Hi,I'm interfacing a garming gps 35 lvc serially. I'm trying to read the longitude and latitude reading
from the $GPRMC string from the GPS.
I found plenty of examples, but I'm not getting any reading on the debug or on the LCD from my GPS.
I'm using a BS2Pe.

it seems that the chip keeps waiting for the gps to send the string "RMC" with a wait("RMC") to read data, but nothing happens.
it stays idle forever.

·I first tried the sample code wich uses a wait("@"), and I do get some garbage like every 4 minutes or so and it diplays to the lcd and the debug screen,· but when I changed to the wait("RMC"), nothing happens.

here is some of my code which is really messy ·because I'm using a example I found on the parallax sample amd commented some of the old commands so I could see the old example.
can anyone please help me.
thanks

Walter

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-29 02:00
    Walter,

    ·· What baud rate does the GPS unit communicate at?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-29 04:37
    Walter,

    The code you're attempting to adapt is not suited for the $GPRMC string; that code was written for the Garmin text output that uses fixed field formatting instead of comma delimited fields as with $GPRMC (my original comments in the program explain that).· Earlier I wrote code that takes advantage of the BS2p-family SPRAM.· See this article for details on receiving and parsing standard GPS strings:

    http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv83.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WalterWalter Posts: 17
    edited 2005-06-29 11:57
    Chris, the Garmin GPS communicates at 4800B by default, but you can adjust the rate.

    thanks Jon,
    I will try this when I get home later on tonight. and see what happens.
    Thanks

    Walter
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-29 13:04
    If you can adjust the Garmin model you have for 2400 and fixed text output then the first program (unmodified) will work for you. I use that version for the BS2. If I'm using the BS2p (which is faster), I use the other program and parse the data from the $GPRMC string with subroutines in the program described in my column.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WalterWalter Posts: 17
    edited 2005-06-30 00:12
    no luck with the code, still not reading anything. stays idle. the debug iscreen is black with the headings only.
    it does not pass the wait ("GPRMC"). I don't know why.
    It can't find the string I guess.

    I'm so frustrated


    walter
  • WalterWalter Posts: 17
    edited 2005-06-30 01:59
    Yes!....it works. it took me a while to figure it out why it was not reading. I had to adjust the Baud rate.
    since I'm using a BS2Pe the one in the sample doesn't work. chaged my constants to:

    T4800 CON 188
    Inverted CON $4000
    N4800 CON T4800+Inverted

    wow....I can sleep better tonight. the only thing is that this a lot of code just for this. in my memory map it shows my eeprom 77% full.
    Jon, thanks for the help
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-30 02:39
    It does take a chunk of code to parse the data out of comma delimited string that's stored in the SPRAM. The BS2pe has eight program slots, though, so you'll be okay once you get going.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WalterWalter Posts: 17
    edited 2005-06-30 04:09
    Jon,
    I'm not familiar with the different program slots.. I see some sample code in the BS2 manual under the Store command. I'll have to do some reading. do you recommend combining all the slots by using pointers to create one big eeprom so i can have room for my project?

    Thanks

    Walter
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-30 13:30
    Depends on your needs.· We built a GPS datalogger for a model airplane that "flattened" the unused program slots into storage EEPROM.· You can, of course, mix and match; perhaps you need two program slots for code, that leaves six (12k) for data.· It's up to you and your application.

    I've attached one of our older programs to help -- it could stand a bit of updating though, so look for and take advantage of any opportunities to improve the code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • WalterWalter Posts: 17
    edited 2005-07-04 19:27
    Thanks Jon,
    Interesting code. I'll have to spent some quality time and trying to uderstand it. I'll refer back to the manual.
    Since I have may events hapening at the same time, motor,gps,sensors, I would like all my code to be in a flat slot. I think It will work if my code is in two slots, but I'll have to see.

    thanks

    Walter
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-07-04 20:01
    I just remembered you are using the BS2pe -- The nice thing about it is that you actually have 16 slots; so you can use two slots for your code and 14 (28 kBytes) for your data. The BS2pe was designed especially for datalogging applications.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.