GPS VPN1513 Documentation question
JohnR2010
Posts: 431
I have a question about the documentation of the VPN1513 GPS. First a comment. You have to preference each call (in smart mode) with !GPS. That needs to be in the documentation someone from Parallax please, please, put it in. Oh and while your at it, the day and month needs to be swapped on page 4. The VPN1513 responds with "Day, Month, Year" and the documentation says "Month, Day, Year"
Now for my question. I could use a little help with the Latitude and Longitude Fractional Minutes format. Here is a snippet of my SPIN code:
gps.str(String("!GPS"))
gps.tx($05) 'Get Latitude
Byte[@gpsLat][4]:=gps.rx 'Degrees
Byte[@gpsLat][3]:=gps.rx 'Minutes
Byte[@gpsLat][2]:=gps.rx 'Fractional Minutes MSB
Byte[@gpsLat][1]:=gps.rx 'Fractional Minutes LSB
Byte[@gpsLat][0]:=gps.rx 'Direction 0=N 1=S
I simply create a 5 byte array "gpsLat" and grab each byte as they come in after I send the "!GPS5 command. At first look the data looks good but my question is what do they mean by "Fractional Minutes"? The numbers i get don't appear to be in floating point format. I would like to understand what format the two byte Fractional Minutes is in. Thanks. Oh I'm not interested in changing the firmware of the VPN1513 I think this is a simple case of incomplete documentation or the lack of understanding on my part I feel like i'm so close.
Now for my question. I could use a little help with the Latitude and Longitude Fractional Minutes format. Here is a snippet of my SPIN code:
gps.str(String("!GPS"))
gps.tx($05) 'Get Latitude
Byte[@gpsLat][4]:=gps.rx 'Degrees
Byte[@gpsLat][3]:=gps.rx 'Minutes
Byte[@gpsLat][2]:=gps.rx 'Fractional Minutes MSB
Byte[@gpsLat][1]:=gps.rx 'Fractional Minutes LSB
Byte[@gpsLat][0]:=gps.rx 'Direction 0=N 1=S
I simply create a 5 byte array "gpsLat" and grab each byte as they come in after I send the "!GPS5 command. At first look the data looks good but my question is what do they mean by "Fractional Minutes"? The numbers i get don't appear to be in floating point format. I would like to understand what format the two byte Fractional Minutes is in. Thanks. Oh I'm not interested in changing the firmware of the VPN1513 I think this is a simple case of incomplete documentation or the lack of understanding on my part I feel like i'm so close.
Comments
Lat[4] = 30 Lat[3] = 15 Lat[2] = 1 Lat[1] = 234
John Abshier
Here is what i have come up with. From wikipedia: GPS receivers have three common formats for reporting coordinates. They are: DMS (Degrees, Minutes, Seconds), MinDEC (Degrees, Minutes, Decimal Minutes), and DegDec (Decimal Degree). From what i can tell the VPN1513 GPS Reciver Module(#28506) reports its GPS coordinates in MinDEC format. So the answer to my above question is this: The two byte Fractional Minutes are in fact the MSB (Most Significant Byte) and LSB (Least Significant Byte) of the numbers to the right of the decimal in the MinDEC GPS format. So I think your example should look like this:
GPS location is 30 degrees 15.1234
Lat[4] = 30, Lat[3] = 15, Lat[2] and Lat[1] are actually the MSB and LSB of a word size integer representing the value to the right of the decimal (1234). I wrote a SPIN Object that reads the VPN1213 GPS and converts this number into a floating point value representing the Decimal Degree format. If anyone would like a copy i will post it to this forum.
Thank you very much for taking the time to reply it sure helps to chat with someone.
You could try to use the raw mode. After all smart mode is intended for use with less performing micros.
There are many objects in the obex, and also a nice app note on the site www.parallaxsemiconductor.com/
Some of them convert to float, or you can find a lot of nice stuff, including a regexp object...
Even better use the propeller on board. There is the firmware on the product page so you can flash to stock if you want to.
GPS units use the NMEA protocol, and if you check it you'll find the coordinates are in the decimal minutes format as default.
GPS is great fun and if you are interested in this kind of stuff you'll enjoy the journey for sure.
Massimo
-- Gordon