Introduction
Parts for "hand_held":
Embedded Microcontroller: |
|
Kit: |
|
Wireless Connection: |
|
GPS Tracking: |
|
Direction Tracking: |
Honeywell Triple-Axis Compass and Freescale Triple-Axis Accelerometer |
Data Save: |
|
LCD Display: |
Newhaven 1.5"x1" |
**See BOM.xls for more detail at the end of this document.
Process for "hand_held":
Xpresso1343:
This Xpresso dev board is compatible with an "Eclipse IDE" called "LPC Xpresso". After registration of the product, example code can be downloaded and imported. This code was immensely helpful for getting off on the right foot.
The Xpresso series has a break away debugger that can be used as a JTAG debugger for other applications (I never tried this, but that's what is says in the datasheet.
There was also an extra expansion board (EA-XPR-021-ND) that came with even more code examples. This is where the I2C to DUART chip came from.
The code that was used for this board was exported and added to the zip file at the end of this project under the folder called code.
GPS:
Both units use a Linx all-in-one GPS receiver (RXM-GPS-SR-B). We chose this one because it is easy to use, small, and the antenna was packaged with the unit.
The GPS Unit was set to query on both units, where a pre-calculated message was sent which triggers the GPS to send out a message.
The foot print is a SMD that requires the antenna to be hanging off the board (see eagle library "Digi-key Rocket Project.lbr").
Xbee:[
The 2.4Ghz Xbee-Pro "point to multi-point" Xbees was used. Configuration proved to be relatively simple for these radios through Digi's X-CTU computer app and dev boards.
There were two functions that we used on the Xbee: The first was the wireless UART communication. The second was a wireless pin mirror mode. The wireless UART was to receive constant GPS data from the Rocket and afterwards, the logged flight data. The Pin mirror mode was used to send commands back to the rocket for "Reset", "Start Logging (Launch)", and "Receive Logged Data (Receive)".
Ground testing yielded an estimate of .25 mile range. This was with extended range enabled.
The configuration files needed to implement this project are in the zip file at the end of this document. There is readme.txt in there too that is helpful.
I2C/DUART:
An extra UART connection was needed to receive from the rocket. This chip was provided on the expansion board (EA-XPR-021-ND) that the LPC Xpresso can connect to. The chip had a 64byte buffer which took some load off the micro-processor.
Subroutines were provided with the expansion board and were altered minimally for the needs of the project.
It was verified that soldering this chip in backwards will result in melted plastic. ![]()
I2C/Sensors:
A compass and an accelerometer were used to determine the orientation of the board so that the proper direction could be determined relative to north.
The I2C driver provided with the Base_Board proved difficult and a different driver was used. This was found on the NXP Xpresso forum.
Why do we need an accelerometer? To account for tilt. The magnetic north actually points about 45 degrees into the earth; therefore if you tilt past that point, the compass will think north is in the opposite direction. A simple addition of the two unit vectors was needed to compensate for this occurrence.
A note on the HMC5883: a seemingly random offset is needed for an accurate calculation of North for the compass. This offset was found by spinning the compass 360 degrees on a flat table and averaging the min and max for each the x and the y axeis.
SD Card/SPI:
The driver provided w
ith the expansion board was used with minor tweaking and large optimization to get it to fit on 32k of program memory.
Here is a link to the driver it
To import the hand_ was adapted from. http://elm-chan.org/fsw/ff/00index_e.html
Optimization: The driver is very large only the bare minimum was enabled so that there was room for other code on the chip. Note that -Os and -O2 in the other optimization box will decrease code size the most.
LCD Display:
It proved to be a challenge to interpret the datasheet from the Newhaven display. Luckily there was a reference design provided that gave a the initialization settings needed.
Simply put, the column address is exactly how it sounds and the page address is the rows grouped in blocks of 8 pixels. Also each pixel needed to be clocked in four times, changing what was clocked in would change the grey scale value of the image. Since we were doing just black and white four 1's were clocked in.
The screen updated with both GPS positions in numeric form in the upper right corner. It also had a square in the middle with a happy face moving around it to indicate the position of the rocket with respect to the current position of hand held device. An 'N' for north was there to verify compass orientation.
Handheld Project Files
Board Files:
- Eagle 5.1 Libraries
- Gerber Files
The eagle library and Schematic is compatible with the 5.1 release and above.
There are also footprints for all of the devices used. The gerber files for the internal Digi-mill.
Source Code:
To import the hand_held_code.zip file, you need the Xpresso IDE form NXP. There are instructions in the "Getting Started Guide" for the Xpresso board in the datasheets.zip for importing a new library into Xpresso.