Go Back   PICAXE Forum > Archives > PICAXE Archive 20
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Links: PICAXE Website PICAXE Manual Datasheets Online Store Software & Drivers

 
 
Thread Tools Display Modes
Old 29-10-2006, 07:44   #1
pmolsen
Senior Member
 
Join Date: Jan 1970
Location: Sydney
Posts: 207
Default Reading date from GPS GPRMC

I am trying to read the date from the GPRMC sentence from an EM-406. Equipment is stationary. The problem is the location of the date field keeps changing because the two fields before it, Speed over ground and Course over ground keep changing at random (even though I am stationary) and they are variable length fields.

The speed over ground always seems to be 4 bytes (eg. 0.13 1.27 0.96 2.74...) but there are no guarantees that it will not be more.

But the course over ground constantly changes length from 4 to 6 bytes since it does not pad with zeros on the left. eg. sample values: 327.78 24.35 7.62 242.45 15.37

Is there any way of stopping them from changing all the time so I know where the date is, or do I just have to read extra bytes and search for the commas to try to work out where the date field is?
pmolsen is offline  
Old 29-10-2006, 09:18   #2
Larry
Senior Member
 
Join Date: Jan 1970
Location: Portland OR
Posts: 266
Default

The short answer is you'll have to count commas. Spiritplumber did a nice job with reading GPS in June. that will show you how it's done. He read most every part of the sentence--except time :-)

Just search all forums for GPRMC and his posts will come up.
Larry is offline  
Old 31-10-2006, 00:13   #3
MPep
Senior Member
 
Join Date: Jan 1970
Location: Christchurch, New Zealand
Posts: 748
Default

Hi there,

Just a question, but does your GPS output ZDA?
The reason for asking is that quite a few do, and date is very easy to extract.

Mark
__________________
I thought I was wrong once ........ but I was mistaken!
MPep is offline  
Old 02-11-2006, 03:29   #4
spiritplumber
Member
 
Join Date: Jan 1970
Posts: 55
Default

Since the GPRMC number is going to be bigger than 32768, your best bet is to save each digit in its own variable, then manipulate them to only use what you need -- remember that subtracting 48 from the ascii value (30 in hex) will give you the real value -- you know the position of a digit, so past that it's just a matter of multiplying. The bad thing is that this method does use up a few variables, however, you can use peek/poke to preserve your vars.
spiritplumber is offline  
Old 31-05-2007, 00:00   #5
sivann
New Member
 
Join Date: Jan 1970
Posts: 2
Default

Check this page http://www.softlab.ntua.gr/~sivann/gps2dtmf/ on how to read all NMEA information with a picaxe 18X.

Â*
sivann is offline  
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 16:54.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) Revolution Education Ltd 2007