Home page

Project

Subsystems

Other things

Wiki docs

SourceCodeHowto

Get the source code

Download the source code from

What you're looking for is a file with the name

demosat-firmware-2007-X.zip

where X is a number. These files are snapshots of the development branch. Get the one with the highest number (but if 4 doesn't work try 3).

Download the file and extract it. This will create a directory called demosat-firmware-2007.

Get the avr-gcc tools

You need the avr-libc C library, the avr-gcc C compiler, and the avrdude programming utility. You also probably need make from Cygwin.

Windows

For Windows, download the WinAVR toolset:

And Cygwin, making sure to install the make utility:

GNU/Linux

For GNU/Linux, use your distribution's package manager. The packages might be called avr-libc, gcc-avr, avrdude, and make. On Ubuntu, you have to enable the "Universe" repository.

Build the source

Enter the demosat-firmware-2007 directory.

cd demosat-firmware-2007

Type make.

make

You should see output like this:

avr-gcc  -mmcu=atmega32 -Wall -Wno-unused -g -c -o adc.o adc.c
avr-gcc  -mmcu=atmega32 -Wall -Wno-unused -g -c -o fieldsat.o fieldsat.c
avr-gcc  -mmcu=atmega32 -Wall -Wno-unused -g -c -o gps.o gps.c
avr-gcc  -mmcu=atmega32 -Wall -Wno-unused -g -c -o mmc.o mmc.c
avr-gcc  -mmcu=atmega32 -Wall -Wno-unused -g -c -o serial.o serial.c
avr-gcc -mmcu=atmega32 -o fieldsat.elf adc.o fieldsat.o gps.o mmc.o serial.o
avr-objdump -zhD fieldsat.elf > fieldsat.od
avr-objcopy -O ihex -S fieldsat.elf fieldsat.hex

If you see any error messages, you probably won't be able to go on until you fix them.

Flash the chip

Plug the programmer into the parallel port of your computer. Plug the other end into the ICSP header on the microcontroller board. Connect the board to power.

Run

make flash

(On Windows, you may need to append -P LPT1 to the value of the variable AVRDUDE_FLAGS in the Makefile. I'm not sure.)

You should see progress meters that show how far the flashing has progressed. Once it's finished, disconnect the programmer from the board. Press the reset button and the microcontroller will start running from the beginning.

Preparing the memory card

You have to use GNU/Linux to do all this. Under Linux, the memory card is probably called /dev/sda.

Here's the command to zero the first megabyte on the memory card.

dd if=/dev/zero of=/dev/sda bs=1M count=1

Running the program.

Disconnect the power to the microcontroller board. Ensure that the programmer is disconnected. Insert the memory card. Connect the power.

LED blinks

You can interpret the way the LED blinks. As a general rule,

Three short blinks ( . . . ) mean success, while
Two long blinks ( - - ) mean failure.

You get three short blinks first thing when the program starts to let you know it's initialized. Then for each memory card, you get three short blinks or two long blinks depending on whether the card was initialized. If a card is not connected it can't be initialized.

So if the first memory card is disconnected and the second is connected, you should see

. . . - - . . .

on startup.

After that, you should get five short blinks, spaced out, to let you know the program is running. If at any point after that you see two long blinks, it means something went wrong with a memory card (like someone pulled it out).

Once you've let the program run for a while, disconnect the power.

Looking at the results

Plug the memory card into your GNU/Linux computer. Wait a few seconds for it to be recognized.

See results quickly

dd if=/dev/sda bs=1k count=1 | less

Save results to a file

dd if=/dev/sda of=demosat.dat bs=1M count=1

You don't have to zero the ship before running the program again, but it can help to make sure that you're seeing new results, not leftover old ones.

Settings

The system is set to deploy the servo after 10 seconds of standing still. I haven't tuned the quiescence detector, so it may not sense when it has stopped moving reliably.

If the servo goes backwards or doesn't move to the proper position, don't worry, we can fix it.

The camera will take its first picture five minutes after deployment, then take one picture every five minutes after that, up to 15 pictures.

Page last modified on July 11, 2007, at 12:27 AM