Can't Read GPS
hobeau
Posts: 9
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!
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
You might try hooking this up to a pc and using a terminal program to see what the device is putting out.
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:
›e
[I don't remember, is RMC a default sentence?]
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!!!!
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.
-Phil
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?
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.
[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.]
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.]
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!!!