Thursday, August 30, 2007

GPS is Working

Implementing a NMEA parser to read GPS data proved to be easier than expected. Turns out there's lots of code out there and getting it to work with the Netburner controller was effortless (almost).
Using a standard language like C/C++ is such an advantage when it comes to reusing code. The parser I used was a C++ class originally compliled in an MS Windows environment. Just one change to the headers (which was not standard) and the code compiled in the Dev C++ environment for the Netburner MOD5213. Trying to get this to work in a proprietary language (like the BASIC compilers that are everywhere thanks to the "Stamp" controllers) would have been lots of work.
Having saved a ton of time on the code, I figured I should do something stupid so I could waste a few days trying to figure it out. Turns out the MOD5213 and the GPS are both 'DCE' RS-232 devices so a Null Modem adapter was needed. Sorry, but that just didn't occur to me. A trip to Radio Shack solved the problem.
Anyway, the controller is working great with the GPS now. The parser runs as a separate task and updates the latitude, longitude, time, etc. Since all the serial I/O is done with interrupts, the GPS parser task is "fire-and-forget".

No comments: