IntroductionThe original goal of the project was to build lightweight and cost effective GPS solution for RC plain. The AVR Butterfly board was chosen as cheap but quite functional hardware platform that already have 512 Kb on board flash memory to store log. The board weights only 20 grams without battery. The GPS receiver GlobalSat BR-355 shown on Fig.1 and connectors add another 35 grams so the device may be easily mounted even on the parkflier. The code was derived from excellent gcc port of the original ATMEL AVR Butterfly Application by Martin Thomas. The data logging part of the code were inspired by AVR Butterly Logger though the code was written from scratch to ensure high degree of portability and extensibility. Now adding new data entries to the log is as simple as adding new entry to the log descriptor tables in the C source and in the python script for log download (btget.py). Getting sourcesYou can
How to buildYou need avr-gcc compiler in order to build the project. The WinAVR is perfectly suitable on windows. To build just type make in the project directory. If you don't like building just use butterflygps.hex file located in the project directory. How to installTo install the program onto the AVR Butterfly board you can either use the built in boot loader or ISP programmer. The first approach may not work out of the box depending on the CPU fuses configuration. I used ARVISP mkII as a more flexible solution. Connecting to GPS receiver and poweringAny NMEA compatible GPS receiver may be connected directly to the AVR Butterfly serial port. I used GlobalSat BR-355 receiver. Note that GPS receiver typically requires 5V power. While the Butterfly CPU may be powered from 5V the on board data flash does not. Powering from 5V source does not damage the flash but data reading/writing without errors becomes impossible. So it's necessary to convert voltage down to 3.3V. I used single chip regulator LM2937-3.3 from National Semiconductor. To power device during log downloading you may either use battery or power it from the external source. I used power cable connected to the UCON232 USB to serial bridge (see Fig.2). RunningUpon entering GPS sub menu the device will start receiving GPS data stream. You can monitor various data stream items, start/stop collecting min/max values of the speed, altitude and the number of satellites available as well as start/stop GPS data log. The log is capable of storing 1 data frame per second during about 11 hours. The data buffer is being written to the log every 22 seconds. Unexpected powering the device off doesn't destroy log data except the last unsaved data buffer. The log may contain more than one track so you can start/stop log multiple times and all corresponding tracks will be stored separately. In case the log running time exceeds the storage capacity the oldest data will be overwritten by the newest one so the log will keep the data collected during the last 11 hours of running. You may reset the log any time to logically clear current log content or erase the log physically. Unless the LOG_DEBUG macro is undefined you also have the possibility to run log test sequence which is useful for checking the storage for data errors. The log format has checksums embedded in the data stream so errors will likely to be detected. Log manipulation toolsThere are 3 tools written on python:
Links
Copyright (c) 2009 OlegV |
Fig.1 Butterfly GPS on Maxi-Swift with BR-355 receiver |
Fig.2 Firmware development setupFig.3 RC plane flight record in btplot viewerFig.4 RC plane flight record exported to Google Earth |