3D Robotics
In an earlier post (and here), I showed how to switch the Basic Stamp autopilot from the Parallax GPS module to the better EM406. The reason to do this isn't just the superior reception of the EM406. It's also that the original version of the Basic Stamp autopilot is based on the Parallax GPS Module's "smart mode" of receiving GPS data, which is both incompatible with all other GPS modules and with all known GPS simulators.

So this was as good a time as any for me to upgrade the Basic Stamp autopilot for the EM406, so we can both use a better module and use GPS simulators (as described in this tutorial). If you want to use a GPS simulator with your Basic Stamp autopilot, you MUST make this change.

Here's the beta code of my port to the EM406. It was kind of a hassle, due to the different ways the two modules give GPS data, but the new version has a built-in GPS parser and is otherwise a lot more robust and can handle any GPS module you want to pair it with. It's also cleaned up a bit, so it's simpler and easier to follow. Tomorrow I'll test it with hardware in the loop and see how it does...

[UPDATE: I caught a lot of bugs in this code, including my stupidity in forgetting that if you place a value in two bytes of scratchpad memory with a PUT [location] Word [value] command, you've got to do the same when you GET: ie, "GET [location] Word [variable]". In the previous code I was PUTing with a Word modifier, but not including that modifier when I'd GET. Anyway, it's all fixed in the code linked in the paragraph above. Still need to do some tweaking to do the conversions properly to get around the limited variable space, but we're pretty close.]

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones