Shop OBEX P1 Docs P2 Docs Learn Events
Can't Read GPS — Parallax Forums

Can't Read GPS

hobeauhobeau Posts: 9
edited 2010-10-23 14:28 in Accessories
Hey world,

I'm really new to the world of electronics so hopefully I'm not asking questions pre-maturely. I just bought a PMB-688 from parallax website and #1 can't find any documentation on how to connect the GPS device to my basic stamp II. I did, however, find some code here: http://www.parallax.com/dl/docs/article/GPSReadings.pdf and noticed that it is written for NMEA 0183 so I figured it would work (since the PMB-688 uses NMEA 0183). I've connected the power to the VDD/VSS and it powers on and the light blinks for a few seconds and then is solid (I'm assuming that means it found satellite). I've connected the TTL TX to pin 13 and the TTL RX to pin 12. I have the following code to just read from the GPS:


' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM5}


gpstime VAR Word
gpstime2 VAR Byte
N VAR Word
W VAR Word
NN VAR Word
WW VAR Word
speed1 VAR Word
speed2 VAR Nib
course1 VAR Word
course2 VAR Nib
n4800 CON 16572


main:
SERIN 13, n4800, 2100 ,nogps1, [WAIT("RMC,"),DEC gpstime, SKIP 3, DEC N, DEC NN, SKIP 3, DEC W, DEC WW, SKIP 3, DEC speed1, DEC speed2, DEC course1,DEC course2]
PAUSE 780

DEBUG N, " ", NN, " ", W, " ", WW
GOTO main

nogps1:
DEBUG "no gps", CR

GOTO main


The only thing that ever comes back from the device is 'no gps'. Can anyone help? Thanks in advance!

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-09-03 16:34
    That means you are timing out without the stamp seeing RMC,
    You might try hooking this up to a pc and using a terminal program to see what the device is putting out.
  • hobeauhobeau Posts: 9
    edited 2010-09-03 16:37
    P.S.

    I modified my code to just see if I could pull anything from the device:

    gpstime VAR Word
    gpstime2 VAR Byte
    N VAR Word
    W VAR Word
    NN VAR Word
    WW VAR Word
    speed1 VAR Word
    speed2 VAR Nib
    course1 VAR Word
    course2 VAR Nib
    n4800 CON 16572
    test VAR Word

    main:
    SERIN 13, n4800, 2100 ,nogps1, [test]
    PAUSE 780

    DEBUG test, CR
    GOTO main

    nogps1:
    DEBUG "no gps", CR

    GOTO main


    And I do get a string of characters such as the following:

  • hobeauhobeau Posts: 9
    edited 2010-09-03 16:39
    Thanks for the quick reply, I have hooked it up to my PC but nothing will read because this is TTL voltage levels (between 0v and +5v) and your PC reads on higher voltage levels (-10v and +10v)
  • hobeauhobeau Posts: 9
    edited 2010-09-03 16:55
    hmmm, it almost looks like my BAUD rate is off or something, I'm getting in the following:

    ›e
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 17:08
    I think that you need to use 188 for your baudmode, that's 4800 8N1, "True".

    [I don't remember, is RMC a default sentence?]
  • hobeauhobeau Posts: 9
    edited 2010-09-03 17:21
    Thanks PJ Allen,

    I just got your message after trying 188 and voila. Right on. What I'm getting back seems like its correct:

    $PS,,,20,4313,06,5,00,5042,24,0,7
    GGV321,72,0,50,8162,51,1,3,2302
    $PS,,,21,9002,90,4,2,5042,70,3,
    no gps
    $SF4,,,22F35964340933756BCC97F2996CC041FF9F623C7
    $SF4,,02C31DB512F8288BB9796D645628465E6FC013520*D
    PR1031,22F35964340933756BCC97F299AA004400385C603
    $SF4,,,22F35964340933756BCC97F299B7EFBFF0A0E3A87
    $SF4,,,22F35A60340713736BC5680499CA804DFFCC5B100
    $SF4,,32C31DBF82F037745686929BA9D760A1A83F273F5*9
    $PS,,,20,4313,06,5,10,5042,24,0,8
    GGV321,72,0,50,8162,51,1,3,2302
    $PS,,,21,9002,90,4,2,5042,70,3,

    This looks more like comma delimited info from the GPS. The next problem I'm having is understanding what I'm looking at. On parallax website they provide a link:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/PULSTAR_NMEA_commands.pdf
    that gives NMEA commands/messages but nothing I see in this documentation seems to be what I'm receiving from the GPS device. Am I looking at the wrong docs? Thanks again for your help!!!!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 17:34
    You are looking for the $GPRMC sentence? I think that is not enabled when it comes to you stock. You have to use the App to configure (or be super_hep and confident to send the config codes via the Stamp.)
    I've attached a ZIP with the SiRF application and information, it's what I use/used, but you need a true RS232 interface to use the PC with it. Which is what I did... in another Subject, I'm not unfamiliar with this product.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 17:38
    BTW, Parallax have just released a new GPS board, $80. The have a bunch of dox, etc. for it, some of it might be useful for the 688 nonetheless.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-09-03 17:38
    In your DEBUG statement, the N, NN, etc. need to be output as DEC N, DEC NN, etc.

    -Phil
  • hobeauhobeau Posts: 9
    edited 2010-09-03 19:55
    Thanks for all the responses guys.

    PJ Allen I think your right. Right now it looks like I'm receiving the SIRF protocol instead of NMEA. I just need something simple and would like to just use NMEA. I got the software you sent but I don't know how to connect this device up to a regular RS232? Is there a way to just tell the GPS to switch to NMEA?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 20:04
    Isn't that covered in that SiRF document in the ZIP? I don't know the config code/s to enable/disable sentences, but it is possible to do by SEROUT.
    I have the 232 aspect covered, so I always use the app, a couple of clicks, done.

    It's a good unit, but the site support for it, in comparison to the rest of it, is dismal.
  • hobeauhobeau Posts: 9
    edited 2010-09-03 20:13
    hmm, if thats in the documentation I'm missing it. How did you connect your device to your PC when it communicates over TTL?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 20:16
    I use a MAX232-based interface (TTL-to-RS232)
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 20:23
    The 688's data is TTL/Parallax True. If it was Inverted, then you might be able to work it with your PC and the SiRF app, anyway.
    [If you have an inverter IC around, instead, maybe you'll get lucky and be able to push it that way (?) I'm not a strong advocate.]
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-09-03 20:34
    Here's Sparkfun's schematic -- http://www.sparkfun.com/datasheets/Prototyping/RS232-Shifter-v2.pdf

    They sell that as a kit, too.

    [It's just that I think addressing the GPS without the app will be no mean feat, a real pain in the hole.]
  • hobeauhobeau Posts: 9
    edited 2010-09-03 20:52
    Hey PJ Allen,

    Thanks for all your help. Yeah I've been messing around with this protocol for the past several hours coming to the realization I'm just going to have to pony up and buy a shifter board. Its not that I don't have the $$$ its just that I'm as impatient as a 10 year old on Christmas Eve. lol Your 200% right, this is not something you want to deal with without their software and from what I can see, it would take me weeks to learn how to parse all of the binary stuff in the SIRF protocol and the NMEA protocol has everything I need for this project. Thanks for your help. Your a life saver!!!
  • JBHJBH Posts: 3
    edited 2010-10-23 14:28
    I have found if you want to hook your gps to your computer you can use your parallax board. Just take the chip out and hook the ttl data lines from the gps to where the data comes into the chip. Thats what I did with my PPDB and my 688
Sign In or Register to comment.