Shop OBEX P1 Docs P2 Docs Learn Events
Please Help - GPS Object for Parallax GPS Module + Propeller Chip? — Parallax Forums

Please Help - GPS Object for Parallax GPS Module + Propeller Chip?

Kevin HinesKevin Hines Posts: 8
edited 2008-06-22 04:50 in Propeller 1
Please help.

I would like to find a Propeller object, to use the Parallax GPS module with the Propeller chip.· (I want to use this for GPS based autonomous navigation of an outdoor, RC car).

I am using the PropStick USB Education Kit, and I would like to interface & read GPS data from the Parallax GPS Receiver Module, Item Code 28146, http://www.parallax.com/Store/Sensors/CompassGPS/tabid/173/ProductID/396/List/1/Default.aspx?SortField=ProductName,ProductName

I apologize if this info is already posted somewhere here in the forum or in the prop object exchange... I searched both the forum and the object exchange, but I couldn't find an object for this·specific application.

I did find the following "GPS to VGA" object set, but it warns "Not designed for parallax GPS but it may work i'm not sure", at http://obex.parallax.com/objects/225/ .· The code·in this object·uses one pin for serial transmit, and one·pin for·serial receive;·however the Parallax GPS module·has just one serial I/O pin (plus a "raw" data pin), so this object doesn't seem to match the·serial I/O needs·of the Parallax GPS module.

I am new to the Prop, and also to GPS...·it·is quite·fun learning·to use the Prop chip.

Thanks,
Kevin

Kevin Hines
Newbie to the Propeller
kevinhines@aol.com

Comments

  • sylvie369sylvie369 Posts: 1,622
    edited 2008-06-19 11:01
    The Parallax GPS has four pins: +5 V, Ground, Data, and a pin that selects between smart mode and raw GPS data. The only serial connection you'll need will be the input to the Propeller from the Data pin. You'll need to use a resistor between the Data pin and the Propeller input pin (since the GPS is 5V and the Propeller is 3.3V):

    http://forums.parallax.com/showthread.php?p=585920

    Supply 5V to the GPS, but don't send that to the Propeller chip anywhere. The only place the two should be connected is through the GPS Data pin and one of the Propeller I/O pins (through a resistor).

    Other than the smart/raw pin, there is nothing to send to the GPS unit, unless you're planning to use smart mode (in that case, ignore everything I'm telling you and wait for someone smart to answer your question*).

    You can probably pull the smart/raw pin to ground (for raw mode) and then use a standard Propeller serial object to read the data from the GPS. I've used the Parallax GPS with various Stamp modules that way, though I haven't yet connected it to a Propeller.

    Once you've got it hooked up, you'll need to read serial data and look for the characters $GPGGA. They signal the start of the·data you're going to want to parse:

    http://home.mira.net/~gnb/gps/nmea.html

    The data will look like this (including the commas separating fields):

    $GPGGA,170834,4124.8963,N,08151.6838,W,1,05,1.5,280.2,M,-34.0,M,,,*75

    The link I gave shows how to decode them.

    * Like these guys:

    http://forums.parallax.com/showthread.php?p=636124



    Post Edited (sylvie369) : 6/19/2008 3:58:06 PM GMT
  • Kevin HinesKevin Hines Posts: 8
    edited 2008-06-20 03:40
    Sylvie,

    Thanks! I will look through all of this and try what you recommended.

    Thanks for the point that I could just operate in a receive mode, rather than both send and receive.

    While only using receive is simpler, I wonder what the advantages are to using both send and recieve?

    Thanks,
    Kevin
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-06-20 16:36
    Kevin Hines said...
    Sylvie,

    Thanks! I will look through all of this and try what you recommended.

    Thanks for the point that I could just operate in a receive mode, rather than both send and receive.

    While only using receive is simpler, I wonder what the advantages are to using both send and recieve?

    Thanks,
    Kevin
    With the Parallax GPS the advantage to using the send-and-receive "Smart mode" is that the device will send you just the information you're requesting:

    Send "GetSats", receive one byte giving the number of satelites you're receiving.
    Send "GetTime", receive three bytes repesenting GMT (H:M:S).
    Send "GetData", receive three bytes representing the GMT date (M[noparse]:D[/noparse]:Y).
    Send "GetLat", receive five bytes representing the latitude (D:M:fractional M:fractional M:direction).

    etc.

    If you use the receive only mode, the GPS just sends out NMEA strings over and over again. It sends the GGA, GSV, GSA, and RMC strings, and you have to dig through all of the bytes of data contained in those strings to retrieve just the data you want. In short, the advantage of using smart mode is that you get just the information you want. The disadvantage is that you need to send out the commands, and you need to hook up the one additional wire. Not that big a deal either way, in my opinion.

    You should carefully read the documentation for the GPS, which you can download from Parallax.com. It's very informative.
  • rjo_rjo_ Posts: 1,825
    edited 2008-06-21 03:06
    Kevin,

    look here: http://forums.parallax.com/forums/default.aspx?f=25&m=195562

    This is a smart mode object by Gary Boone, PhD.

    I tried everything else and settled on Gary's object. I left the smart pin floating and it works fine. I put a (1K) resistor between the signal pin on the GPS unit and the prop pin.

    How do you like your PropStick Education Kit ?... it looks pretty slick

    Rich
  • Kevin HinesKevin Hines Posts: 8
    edited 2008-06-22 04:50
    Sylvie and Rich,

    Thanks to you both, and also to DrGary's code, I now have my Propeller working together with the GPS module, in Smart mode! smile.gif

    Using Dr.Gary's objects makes the job of getting the GPS data very easy and convenient!

    I like the smart mode a lot, but it takes about a full second, for each·"get" method call to retrieve·a value from the GPS module.

    For example, a·repeat loop to get·5 values, (eg. Valid, Longitude, Latitude,·Speed, & Heading)·takes about·5 seconds in order to retrieve these·values.

    I ran a test, and unless I am mistaken, almost all of the time is taken up by waiting for the "get" method to send & then receive it's reply from the GPS module.· I have a hunch that, perhaps since the Parallax GPS module only updates once per second, that the "Get" methods may have to wait for the next, once-per-second update from the GPS module, rather than just immediately returning the data values from the previous once-per-second update?

    How can I "get" all 5 values at once?·

    I appreciate all of your help!

    Thanks!
    Kevin

    PS - The Prop Stick Education Kit is excellent.

    Post Edited (Kevin Hines) : 6/22/2008 8:29:25 PM GMT
Sign In or Register to comment.