Thursday, December 14, 2006
Some stressing, a few all-nighters, and a dream...
Against all odds, the iGPS came together in time for its demonstration. A source position is set using the clickwheel, and three display options, distance to source (m), time of trip, and velocity (m/s) are selected by turning the clickwheel. Cardinal directions to the source location are given by the four red LEDS between the display and the clickwheel, and the led to the right indicates whether or not the GPS device has a satellite fix.The project is based around the Freescale 9S12C microcontroller. All coding was written in assembly using ASMIDE.
Naturally, we had to run with it.
We hit up Radio Shack and bought a project case with a metal grounding plate which we used as te project's actual back plate for that iPod feel. We painted the case white, drilled some holes for indicator lights and mounted a light dimmer switch 'clickwheel.' The dimmer was gutted for independent potentiometer and pushbutton functions.
The most challenging problems we encountered were the conversions from hex to decimal and decimal to hex. This seems like it should be a relatively simple switch, but it took nearly a day to figure out. The GPS receiver transmitted data as ASCII strings, which were stored in memory as packed BCD numbers. Without a conversion, the squaring and square roots required to calculate distance and division to calculate velocity would be impossible. In the end, it all started working.
The last night of the project was a long one. Shown to the right is the first working prototype of the iGPS in a much larger housing. The space required by the microcontroller, PLDs, and SPI required three separate breadboards.
Testing the iGPS on a really cold December night.
The complete circuit
Friday, December 1, 2006
NMEA: Protocol of Choice
After two days looking at serial dumps from TSIP and playing with Windows calculator, NMEA is the protocol of choice, it seems.
Why?
ASCII
NMEA Format:
$GPGGA,hhMMss.ms,XXXX.XXXX,D,XXXX.XXXX,D,otherdata
The important part here is the XXXX.XXXX,D, which are latitude, longitude, and direction (N/S, E/W). No floating point conversion necessary. Thanks Trimble.
The Trimble GPS unit gives three different output modes, TSIP (binary data), TAIP (ASCII), and NMEA (ASCII). TAIP seems somewhat difficult to configure, but NMEA transmits latitude, longitude, time (in a usable format), and direction right out of the box.
TSIP seemed to be the method of choice because of the output options it allowed (in particular, coordinates in XYZ), but working with floating point data might be a little out of the scope of this project.
NMEA transmits by default at 4800bps, so the SCI baud rate had to be changed from 0x009C to 0x0138. NMEA does not provide XYZ coordinates, so, no easy calculation of meters, but we're confident we can assemble some sort of reasonable approximation from latitude and longitude.
In an hour or so, Zach whipped up a simple prototype that correctly read in latitude and longitude data in packed BCD format, set this data, and provided the direction (North, South, East, West). It worked reasonably within the confines of his room.
Maybe someday we'll buy batteries.
Why?
ASCII
NMEA Format:
$GPGGA,hhMMss.ms,XXXX.XXXX,D,XXXX.XXXX,D,otherdata
The important part here is the XXXX.XXXX,D, which are latitude, longitude, and direction (N/S, E/W). No floating point conversion necessary. Thanks Trimble.
The Trimble GPS unit gives three different output modes, TSIP (binary data), TAIP (ASCII), and NMEA (ASCII). TAIP seems somewhat difficult to configure, but NMEA transmits latitude, longitude, time (in a usable format), and direction right out of the box.
TSIP seemed to be the method of choice because of the output options it allowed (in particular, coordinates in XYZ), but working with floating point data might be a little out of the scope of this project.
NMEA transmits by default at 4800bps, so the SCI baud rate had to be changed from 0x009C to 0x0138. NMEA does not provide XYZ coordinates, so, no easy calculation of meters, but we're confident we can assemble some sort of reasonable approximation from latitude and longitude.
In an hour or so, Zach whipped up a simple prototype that correctly read in latitude and longitude data in packed BCD format, set this data, and provided the direction (North, South, East, West). It worked reasonably within the confines of his room.Maybe someday we'll buy batteries.
Blue Team: It Begins
After considerably debate, we've finally settled on what exactly our project is going to do. The GPS receiver is connected to the microcontroller using the SCI. The data is received using the NMEA protocol, typically used for navigating ships. This information is converted from it's standard ASCII output and loaded into memory. A button or dial allows a current position to be set, and the device outputs direction and distance to the set position, or possibly to other presets.
Subscribe to:
Posts (Atom)
