Searching \ for '[PIC]: GPS Code' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=gps
Search entire site for: 'GPS Code'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: GPS Code'
2000\12\28@164259 by cflat

flavicon
face
Hi all,
I have a need to read the NMEA port on a GPS receiver and parse out
the RMC and/or GGA sentences.  A search of the archive revealed code
in Parallax, does anyone know of any assembler code available?  I
will be using a 16f877.  I thought I'd try this request before I
begin working on it to see if I can help reduce development time.
Thanks for any info,
Charles

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\29@065102 by kayode.ayandokun

flavicon
face
> Hi all,
> I have a need to read the NMEA port on a GPS receiver and parse out
> the RMC and/or GGA sentences.  A search of the archive revealed code
> in Parallax, does anyone know of any assembler code available?  I
> will be using a 16f877.  I thought I'd try this request before I
> begin working on it to see if I can help reduce development time.
> Thanks for any info,
> Charles

You can find a 16F84 based project with source code available at
http://www.users.bigpond.com/tobbe/dl7aot.htm

There are also a couple of PC programs for creating *.sti files for NMEA
sentences available for download from the free demo code page at
http://www.stv5730A.co.uk

Kayode.
________________________________________________________________________
Visit http://www.stv5730a.co.uk and put your next PIC project on TV
with the 16F84 STV5730A on screen display project board.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\29@072644 by Russell McMahon

picon face
/Hi all,
/I have a need to read the NMEA port on a GPS receiver and parse out
/the RMC and/or GGA sentences.  A search of the archive revealed code
/in Parallax, does anyone know of any assembler code available?  I
/will be using a 16f877.  I thought I'd try this request before I
/begin working on it to see if I can help reduce development time.
/Thanks for any info,
/Charles


I  can't help directly with code but would be interested in your results.
I'm about to do a GPS read implementation on a Scenix (once I get the
should-be-trivial virtual UARTS working properly) but will be passing
selected sentences on to a main cpu without processing.

However, I have been decoding selected sentences in BASIC (! :-( ) and it is
a relatively trivial task due to the fact that for a given sentence, all
fields are always present even when data is absent, with comma delimiters
being provided for fields with null data.  This means all you have to do is
"count the commas" from the string identifier and then read everything from
the  comma of choice until the next comma.

RMC and GGA are almost always nicely behaved with the absolute length of the
fields not varying so that you can even just count N characters from the
string identifier and then take a set number of characters as your data.
About the only time this is NOT valid is on startup prior to acquisition. In
such cases the absence of the latitude and longitude indicators (S & E in y
case, N & ? in yours) from their normal locations would be enough to
indicate invalid data.
Also the validity indicator in field 3 of RMC is a good indicator of
validity :-)

Valid:
$GPRMC,082841,A,3651.9850,S,17438.9070,E,0.136,318.0,301100,19.6,E*5D
Invalid
$GPRMC,082842,V,3651.9850,S,17438.9070,E,0.123,318.0,301100,19.6,E*4D

GGA goes invalid less usefully but more spectacularly:

$GPGGA,082841,3651.9850,S,17438.9070,E,1,00,0.80,41.8,M,26.5,M,,*5E
$GPGGA,,,,,,0,00,,,,,,,*66

Note the commas & null fields.

If I was doing this in assembler, if code space  was not tight, I would
probably write it in pseudo-code or a high level language first and then
translate that to assembler.

regards,


               Russell McMahon

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\30@191637 by kayode.ayandokun

flavicon
face
Russell McMahon <spam_OUTapptechTakeThisOuTspamCLEAR.NET.NZ> wrote:
> [...]
> However, I have been decoding selected sentences in BASIC (! :-( ) and it is
> a relatively trivial task due to the fact that for a given sentence, all
> fields are always present even when data is absent, with comma delimiters
> being provided for fields with null data.  This means all you have to do is
> "count the commas" from the string identifier and then read everything from
> the  comma of choice until the next comma.
>
> RMC and GGA are almost always nicely behaved with the absolute length of the
> fields not varying so that you can even just count N characters from the
> string identifier and then take a set number of characters as your data.
>
To write code that will work with any GPS receiver's NMEA output you
can't just count characters.  The field width for the time can vary
dependent upon whether the receiver outputs seconds or not.  The field
widths for latitude and longitude can also vary with 3 or 4 characters
after the decimal point.  I'd suggest to anyone developing a general
NMEA parser to look at examples of NMEA data sentences as well as the
output from their own receiver.  If you stick with the comma delimiters
then you avoid having to consider any of these differences.

Kayode.
________________________________________________________________________
Visit http://www.stv5730a.co.uk and put your next PIC project on TV
with the 16F84 STV5730A on screen display project board.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2000\12\31@003107 by cflat

flavicon
face
{Quote hidden}

You are correct Kayode.  You must count commas, not the number of
bytes that could be in a sentence because the
number of bytes change.  The number of commas do not.

Thanks to all who responded to my original request for help on this
thread.  It is greatly appreciated.  Its amazing how many people ask
for my final code when I'm done.  I'll let you guys know when I've
completed it.
Thanks,
Charles

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body



'[PIC]: GPS Code'
2001\01\02@212238 by Barry Gershenfeld
picon face
>To write code that will work with any GPS receiver's NMEA output you
>can't just count characters.  The field width for the time can vary
>dependent upon whether the receiver outputs seconds or not.  The field
>widths for latitude and longitude can also vary with 3 or 4 characters
>after the decimal point.  I'd suggest to anyone developing a general
>NMEA parser to look at examples of NMEA data sentences as well as the
>output from their own receiver.  If you stick with the comma delimiters
>then you avoid having to consider any of these differences.
>
>Kayode.

Been there.  It's easy to get a receiver and then assume that
everyone's NMEA output looks like that.  I got to try mine on
three different receivers, and there was one that output
numbers with ".000" included.  Needless to say, I kept
revising my parser.    Fixed length is definitely not
going to get you very far.  There will always be a new
surprise.

Barry

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\02@212638 by David VanHorn

flavicon
face
>
>Been there.  It's easy to get a receiver and then assume that
>everyone's NMEA output looks like that.  I got to try mine on
>three different receivers, and there was one that output
>numbers with ".000" included.  Needless to say, I kept
>revising my parser.    Fixed length is definitely not
>going to get you very far.  There will always be a new
>surprise.

That's why the comma delimiters are there.

Free clue: packets that have fixed length fields, generally don't have
delimiters.

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\01\03@154459 by Don Hyde

flavicon
face
The way to "cheat" on the parser problem is to write your parser to the
spec.

It can be obtained from the National Marine Electronic Association, which
has a web page:
http://www.nmea.org

Unfortunately, they seem to finance their organization by charging $250 for
the spec, which works out to somewhat more than $2 per page...

I can't simply reproduce the document since it's copyrighted and I don't
want to get sued, but the short version is that it's comma-delimited, and
numbers are variable-length "integer or floating", may include leading or
trailing zeroes, and the decimal point is optional if "full resolution is
not required".

I couldn't find what "integer or floating" really meant, but it does not
seem to mean something like 6.02E23.  It just seems to mean that the decimal
point is optional if you don't need it.

> {Original Message removed}

2001\01\03@155922 by David VanHorn

flavicon
face
>
>I can't simply reproduce the document since it's copyrighted and I don't
>want to get sued, but the short version is that it's comma-delimited, and
>numbers are variable-length "integer or floating", may include leading or
>trailing zeroes, and the decimal point is optional if "full resolution is
>not required".

Under US law, you can copyright a document, but you cannot copyright
information.
So, if you have the document, you can tell us about things, you can even
quote portions of the document. (Fair use doctrine)


>I couldn't find what "integer or floating" really meant, but it does not
>seem to mean something like 6.02E23.  It just seems to mean that the decimal
>point is optional if you don't need it.

In this context, it should mean that integer numbers never have any
fractional component (1,2,3,4  not 1.6, 3.7) and floating could have a
fractional (1,2,3.5,4)

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\03@161959 by Steven J. Devine

flavicon
face
> >I can't simply reproduce the document since it's copyrighted and I don't
> >want to get sued, but the short version is that it's comma-delimited, and
> >numbers are variable-length "integer or floating", may include leading or
> >trailing zeroes, and the decimal point is optional if "full resolution is
> >not required".
>
> Under US law, you can copyright a document, but you cannot copyright
> information.
> So, if you have the document, you can tell us about things, you can even
> quote portions of the document. (Fair use doctrine)

Also, a very cursory search for "NMEA sentence specifications" came up with numerous web sites explaining the specs, some reverse engineered, some with data "collected" from other sources.  Perhaps some poeple took the above sentiment to heart and did so...

Even if incomplete, it would  be a good starting point.

Steve

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\03@163003 by David VanHorn

flavicon
face
A cursory brush with scientology is probably equal to a semester of
copyright law :)

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\03@164413 by Steven J. Devine

flavicon
face
> A cursory brush with scientology is probably equal to a semester of
> copyright law :)

Lookie what I found!!!  Here is an NMEA FAQ, with lots of record formats and details....
   http://vancouver-webpages.com/peter/nmeafaq.txt

> Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

How do you do that, anyway?????

Steve

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...