Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading NMEA 0183 GPS data into a PIC

Status
Not open for further replies.

Sync

New Member
Hi all, this is my first post.

I have a small PIC project that is to read the NMEA 0183 strings from a GPS from the serial port and then, extract some values from it and then, process it and then, turn On/Off a relay on the pcb.

Wich PIC is required ?
I'll use C on MPLAB.

Someone has any hints on how to read the ASCII data from the serial port ?

Many thanks!
 
Any PIC could do it, NMEA is only 4800baud. A PIC with a USART would make the programming simpler. The 16F628A or 18F1320 would both be good choices IMO.
 
It would be easier to use a PIC with enough memory for the whole of the GPS sentence. That way, you can have a simple program to collect the data from the EUSART one character at a time, and store it in memory.

Then you can test the program that looks at the data using MPLAB.

I would use an 18F series PIC.
 
Diver300 said:
It would be easier to use a PIC with enough memory for the whole of the GPS sentence. That way, you can have a simple program to collect the data from the EUSART one character at a time, and store it in memory.

Then you can test the program that looks at the data using MPLAB.

I would use an 18F series PIC.
The data that i need to collect is only from the "GPRMC" line.
The first one start at 15 for 8 char lenght, the second one start at 26 for 9 char lenght and the third one start at 38 for 3 char lenght. Non stop collect. That is all.

From that data collected, i want first to look at the third one and use it to activate a pin 5 volts somewhere on the pcb.

I think this is an easy project but i've never done anything yet on a micro processor. :-(
I'll need some help and hints to begin the project.

Thanks!
 
I would suggest that you install MPLAB and the C18 compiler and have a play with some of the C18 code posted here (Search C18).

To get the string into memory will be something like,
Code:
char chr;
ram char message[64];
ram char *pointer;

pointer=&message[0];
while(chr=GetRS232()!=10){
	*pointer++=chr;
}

The tricky bit with Pics is getting your head round two types of pointers, ram and rom. They are not interchangeable.

The initialisation and reading of the RS232 data is covered in various threads here.

Hope that gets you started.

Mike.
 
I don't know if i can do this here but since i really need this fast, i am willing to Paypal money to someone who is interested to do enough code that let me finish or fine tune it after.
Anyone ? PM me.
Thanks!
 
Status
Not open for further replies.

Latest threads

Back
Top