SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By naz
how to take NMEA message from gps to lpc2148.
User avatar
By leon_heller
Usually, you connect it to a UART.
By naz
yes it's correct,i'm asking about software side.currently we did only uart initialization.apart from that we have take data from gps to lpc2148 memory.give some idea
By MaxQ
The simplest thing is to poll U0LSR (or U1LSR, depending which UART you are using) to see if there are any characters waiting, then pull them into a buffer, e.g.:

char buf[256];
int count = 0;

while ((U0LSR & 1) && (count < 256))
buf[count] = U0RBR;
count += 1;

Then scan through the buffer until you find a '$' character. Throw away everything before this character. Then scan until you find a '*' followed by two more characters and <CR><LF>. This delimits a complete sentence. If you don't have a complete sentence in the buffer, go back and wait for more characters to arrive. If you do have a complete sentence, compute and verify the checksum. If the checksum is correct, process the sentence. If the checksum is incorrect, throw the sentence away and look for the next sentence in the buffer.

Because you have a reliable communications channel (direct connection between the GPS module and the LPC2148 UART), it is probably unnecessary to check the checksum.