gps+bs2
christiand
Posts: 7
Hi!
I would like to know how to extract information (heading, speed, altitude) from a gps with the help from my bs2 and present it in windows hyperterminal or some lcd display.. What I was hoping you could help me with is where I can find code-examples of how to extract the information from my gps receiver? It is a Globalsat BR-355 and i have attached a picture of the pinouts.. Thank´s in advance
regard / Christian
I would like to know how to extract information (heading, speed, altitude) from a gps with the help from my bs2 and present it in windows hyperterminal or some lcd display.. What I was hoping you could help me with is where I can find code-examples of how to extract the information from my gps receiver? It is a Globalsat BR-355 and i have attached a picture of the pinouts.. Thank´s in advance
regard / Christian
Comments
For the former, consult your GPS unit's documentation. For the latter, here are some examples:
BS2 code for reading NMEA strings (this is for the Parallax GPS, but the theory and code for extracting data from the NMEA string is the same): www.parallax.com/Portals/0/Downloads/src/prod/GPSDemoV1.1.zip
Sample code (and circuit) for interfacing Stamps to a GPS (again, this may describe different unit(s) than yours, but the theory and code would be similar): www.parallax.com/Portals/0/Downloads/docs/article/GPSReadings.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
If your GPS outputs signal levels other than TTL 5v, you will need a level-shifter between the unit and your Stamp so you don't fry your Stamp pin. Again, consult your GPS unit's documentation for info about that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
They use a Garmin Etrex and they only seem to use one pin to extract information.. As far as I know I need both Rx and Tx to tell my gps what info I want and for it to send it to me..? It would be nice if I could use the code allready shown in that tutorial..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
http://home.mira.net/~gnb/gps/nmea.html
$GPGGA is the one you probably want to look at first.
Using the Parallax GPS receiver, I just pulled the Raw pin low to get it to send out the raw strings, then used a SERIN·command with·Wait and Skip·to get what I needed. Have it Wait until you get "$GPGGA", then skip through the number of bytes preceding the information you want to look at. For example, if you want the Latitude data, you have to skip the 6 bytes of time data first. Count carefully, and send whatever you're getting to the screen while you're figuring it out so you aren't shooting in the dark.
Using this, I was able to put together a pretty nifty little GPS receiver thing, sending the Latitude, Longitude, course and speed to a 16x4 LCD that I could prop up behind my steering wheel. Worked great.
Does your GPS automatically send out NMEA strings when the power is on and it's receiving enough satellites?
·
Post Edited (christiand) : 12/12/2007 9:24:11 PM GMT
Will greatly simplify your code and hookup headaches. If you are not sending to the GPS, then you just need to tie the grounds together and hook up the TX pin of the GPS to the pin of the Stamp you will use to read the serial info -- TAKING INTO ACCOUNT POSSIBLE DIFFERENCES IN VOLTAGE/CURRENT between the two devices (if any).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
The only change you might need to make is to the SERIN parameters if the serial from your unit is different (inverted, non-inverted, etc).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
cheers / Christian