Update gitignore, add Makefile and hadie.c files

master
Philip Heron 2010-06-07 12:45:35 +01:00
rodzic 6b51e6ae07
commit 048c14ba40
2 zmienionych plików z 88 dodań i 0 usunięć

37
Makefile 100644
Wyświetl plik

@ -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

51
hadie.c 100644
Wyświetl plik

@ -0,0 +1,51 @@
/* hadie - High Altitude Balloon flight software */
/*============================================================*/
/* Copyright (C)2010 Philip Heron <phil@sanslogic.co.uk> */
/* */
/* 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 <avr/interrupt.h>
#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);
}