help with reading nema strings from a gps at 9600 baud

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have a ublox neo-6m and the only strings I have a interest in is gps lock status string and time string, would love to have a idea how to take just those, and extract just that info.

   

 

   

I want to do it on a psoc5lp 059 dev board.

0 Likes
4 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Basically you get the total string into a buffer and use code to extract

   

what is if interest. I presume the nema spec, better yet part spec, has

   

the string format. The using string library functions like search, copy,

   

etc.. pull out the data, still in ASCII, and then use the math conversion

   

functions to convert ASCII string of a number, like sprintf(), to the equivalent

   

numeric integer.  Time strings, date strings, a little more complicated if delimiting

   

chars, like ":" are in the string, then bit banging code to pull out the hours,

   

mins, secs will be needed.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I'm a bit of a noob when it comes to C, how would I get the data into a buffer? 

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

i assume the GPS part has a SPI or I2C or UART interface, so you send a command

   

to do a read, and read the bytes that form the string into an array.

   

 

   

Start with example project in Creator, start page, link "Find Example project",

   

to see representative code for doing various serial links as mentioned prior.

   

 

   

You can also google the chip part number and "driver" or "C Code" to see if there

   

is example code out on the web. It may be for another processor but serial links

   

are standard interfaces.

   

 

   

If new to C go to youtube or google lessons...., there is tons of resources out

   

on the web.

   

 

   

Regards, Dana.

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Here comes some example code for parsing NMEA stream. Try Google translate.

   

odissey1

0 Likes