View previous topic :: View next topic |
Author |
Message |
Ricky
Joined: 19 Sep 2005 Posts: 1
|
read GPS NMEA data using PIC18F452 |
Posted: Mon Sep 19, 2005 3:45 am |
|
|
Hi,
I wish to read off NMEA data off OEM GPS receiver using a PIC18F452 and display it on LCD. Can someone please give me hints on how to do this in terms of code writing or good links? Any help will be much appreciated.
Thanks in advance,
Ricky |
|
![](templates/subSilver/images/spacer.gif) |
EmbdFreak
Joined: 28 Jul 2005 Posts: 23
|
Reading GPS NMEA strings |
Posted: Mon Sep 19, 2005 4:28 am |
|
|
Well, as u know the output of GPS on RS-232 are NMEA strings followed by the data each one holds. Each string starts with a '$' sign followed by several information fields. There are about 10-15 NMEA strings an average GPS gives (depends on model). Now you have which string contains the data u need, e.g. 'GPRMC' gives u latitude, longitude, lat hem, long hem, UTC date,time etc.. . each one is separated by a comma. So u need to implement a kind of parser which will parse this data until a CR,LF is detected, which ends the string. Ur program design should look for '$',upon recieval count number of commas and keep storing/displaying your field of interest. As for LCD, use lcd.c with any hd44780 based lcd display.
I hope this gets u going,
Regards, |
|
![](templates/subSilver/images/spacer.gif) |
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
More advice |
Posted: Mon Sep 19, 2005 7:47 am |
|
|
The GPS sentences are spoken by most GPS receivers about once every second without regard to the state the PIC is in ( asynchronously). You will need a circular buffer to buffer a complete sentence ( 40 to 60 bytes). Look at postings for writing an interrupt driven circular buffer based on an RDA interrupt when a char is received. Do all of the preparation for display to the LCD in your main code and leave the ISR ( interrupt service routine) to filter out unwanted sentences and place good data in the buffer. |
|
![](templates/subSilver/images/spacer.gif) |
pe1icq
Joined: 29 Aug 2005 Posts: 12
|
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
![](templates/subSilver/images/spacer.gif) |
|