The code is Jordi's new NMEA parser for the Locosys GPS. It's checksum verified, rocksolid, continuous, no delays, loop rate is about 32000hz. It uses pointers, so it's efficient.
You have to configure the Locosys for the first time you use it. It's very easy, you just need an FTDI cable. Be sure to connect the GPS to a 3.3 volt source. (We'll do this setup for you in the commercial version)
Instructions (please use the picture above as reference):
1-Run Realterminal and open the port @4800bps, you should see all the NMEA stuff, is not check the connections..
2-Now make sure you have checked the options marked with the green arrow... +CR +LF
3-Copy and paste this code: $PMTK251,38400*27 to the box indicated with the red arrow.
4-Then click the "Send ASCII" button indicated with the blue arrow..
5-Then the NMEA should disappear, and starting showing strange values. Go back to the "Port tab" (yellow arrow),
close the port, and choose the Baud "38400", and open the port again. You should the NMEA data again... =)
6- Then go back to the "Send" tab, and copy&paste this code: $PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 then click Send, this should turn Off all sentences except GGA and RMC
7-Copy&paste now this code: $PMTK220,200*2C This should increase the updates to 5hz... (WOW!!!)..
8- Now you are able to connect the GPS module to Arduino, (only connect the RX pin to the TX of the GPS)
9-Then upload the code above, and open the port monitor, you should see Lat, Lon, Course, Speed, Altitude, Fix Position... like this:
46024504 8050998 312 0 519 1 (and yes you now know the exact position of my Swiss Chalet =P)...
If you want other setup codes for this GPS, you can find them in this datasheet.
Code explanation
If you'd like to understand the NMEA parser code a bit better, here are some of the library functions that it calls (all from the standard C++ library):
- First of all pointers, which are very easy. They just give you the memory address where a variable is allocated in the ram: info
- Then the strncmp(), better know as String Comparator. We use it to compare the header of the NMEA string "$GPGGA": info
- Then strtl(), which means String to Long Variable. It converts a string number into a long variable: info
- Then the strtok(). This is the string tokens, which looks for tokens in a string, for example commas ",", the ones used to separate values in the NMEA sentence: info
- The atoi() will convert strings to integers: info
- If you want to know all the available functions, see the library called "strings.h", "stdlib.h": info and info
Comments
I'm currently running an EM406 and just received my LS20031 in the mail and was wanting to download the code posted above, but code link says access denied? Any ideas? Looking forward to getting this baby talking!
Thanks!
Can someone help me with the PMTK code that only parses out the GGA code, and nothing else?
I have tried setting the '1' for the RMC set to zero, but it does nothing $PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28 .
should the *28 change?
How can i download NMEA parser from this manual?
me too?
Cannot access to the link of Jordi's code NMEA parser for the Locosys GPS...
NMEA_Parser_V11.rar
give access denied...
Can you help ?
Nm previous post. I found a program www.compuphase.com/software_termite.htm which solved everything. I was easily able to send the command to change the rate of output.
Thanks
Does anyone know of a new link to realterm? I can find the latest version all I get is 1.99 and Im not sure how reliable this version is because when I try to connect to my Locosys I get "parameter incorrect" . Not sure what parameter because I know what port I am on and the baud rate Im supposed to be set up to. Its a fresh install. Are there other settings supposed to be set up that arent described?