|
Project Subsystems Other things |
DemoSatV /
SourceCodeHowtoGet the source codeDownload 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 toolsYou need the avr-libc C library, the WindowsFor Windows, download the WinAVR toolset: And Cygwin, making sure to install the GNU/LinuxFor GNU/Linux, use your distribution's package manager. The packages might be called Build the sourceEnter the demosat-firmware-2007 directory. cd demosat-firmware-2007 Type 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 chipPlug 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 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 cardYou have to use GNU/Linux to do all this. Under Linux, the memory card is probably called 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 blinksYou 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 resultsPlug the memory card into your GNU/Linux computer. Wait a few seconds for it to be recognized. See results quicklydd if=/dev/sda bs=1k count=1 | less Save results to a filedd 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. SettingsThe 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. |