From 048c14ba409586aefb6bcd7badba3cfbc4729732 Mon Sep 17 00:00:00 2001 From: Philip Heron Date: Mon, 7 Jun 2010 12:45:35 +0100 Subject: [PATCH] Update gitignore, add Makefile and hadie.c files --- Makefile | 37 +++++++++++++++++++++++++++++++++++++ hadie.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 Makefile create mode 100644 hadie.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..57789e9 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ + +PROJECT=hadie +OBJECTS=hadie.o rs8encode.o + +# Serial device used for programming AVR +TTYPORT=/dev/ttyACM0 + +CFLAGS=-Os -Wall -mmcu=atmega644p +CC=avr-gcc +OBJCOPY=avr-objcopy + +rom.hex: $(PROJECT).out + $(OBJCOPY) -O ihex $(PROJECT).out rom.hex + +$(PROJECT).out: $(OBJECTS) + $(CC) $(CFLAGS) -o $(PROJECT).out -Wl,-Map,$(PROJECT).map $(OBJECTS) + +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f *.o *.out *.map *.hex + +flash: rom.hex + avrdude -p m644p -c stk500v2 -P $(TTYPORT) -U flash:w:rom.hex:i + +setfuses: + # This sets the low fuse to use an external 7.3728MHz crystal, + # with no prescaler + avrdude -p m644p -c stk500v2 -P $(TTYPORT) -U lfuse:w:0xF7:m + + # Use the internal 8MHz osccilator, /8 prescaler (Default) + #avrdude -p m644p -c stk500v2 -P $(TTYPORT) -U lfuse:w:0x62:m + + # Use internal 8MHz osccilator, no prescaler + #avrdude -p m644p -c stk500v2 -P $(TTYPORT) -U lfuse:w:0xE2:m + diff --git a/hadie.c b/hadie.c new file mode 100644 index 0000000..d2be044 --- /dev/null +++ b/hadie.c @@ -0,0 +1,51 @@ +/* hadie - High Altitude Balloon flight software */ +/*============================================================*/ +/* Copyright (C)2010 Philip Heron */ +/* */ +/* This program is distributed under the terms of the GNU */ +/* General Public License, version 2. You may use, modify, */ +/* and redistribute it under the terms of this license. A */ +/* copy should be included with this source. */ + +#define CALLSIGN "hadie" + +#include +#include "rs8.h" + +int main(void) +{ + /* Connections: (PDIP) + * + * 1: PB0 - Output, RTTY space + * 2: PB1 - Output, RTTY Mark + * 3: PB2 - Enable Radio + * 5: PB4 - To pin 1 of MMC card (/CS) + * 6: PB5/MOSI - To pin 4 of ISP header + * - To pin 2 of MMC card + * 7: PB6/MISO - To pin 1 of ISP header + * To pin 7 of MMC card + * 8: PB7/SCK - To pin 3 of ISP header + * To pin 5 of MMC card + * 9: RESET - To pin 5 of ISP header + * 10: VCC - 3.3v + * 11: GND - GND + * 12: XTAL2 - 7.3728 MHz crystal + * 13: XTAL1 - 7.3728 MHz crystal + * 14: PD0/RXD0 - Input, UART camera + * 15: PD1/TXD0 - Output, UART camera + * 16: PD2/RXD1 - Input, GPS data + * 17: PD3/TXD1 - Output, not connected - GPS receive only + * 30: AVCC - 3.3v + * 31: GND - GND + */ + + /* Start interrupts and enter main loop */ + sei(); + while(1) + { + + } + + return(0); +} +