From 368f4dcca9f8fdadfee527345b59f7a7ba6d6367 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sat, 3 Dec 2016 21:16:13 -0500 Subject: Update tools encode a 2.5 MHz signal with the AVR. --- tools/avr_codegen/Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tools/avr_codegen/Makefile (limited to 'tools/avr_codegen/Makefile') diff --git a/tools/avr_codegen/Makefile b/tools/avr_codegen/Makefile new file mode 100644 index 0000000..fc2c712 --- /dev/null +++ b/tools/avr_codegen/Makefile @@ -0,0 +1,37 @@ + +all : test.hex burn test.lst +PART=attiny85 +PROGPART=t85 + +CFLAGS=-g -Wall -Os -mmcu=$(PART) -DF_CPU=8000000UL +ASFLAGS:=$(CFLAGS) +CC=avr-gcc + + +test.hex : test.elf + avr-objcopy -j .text -j .data -O ihex test.elf test.hex + +test.elf : test.c + avr-gcc -I -g $(CFLAGS) -mmcu=$(PART) -Wl,-Map,test.map -o $@ test.c -L/usr/lib/binutils/avr/2.18 + +test.lst : test.c + avr-gcc -c -g -Wa,-a,-ad $(CFLAGS) test.c > $@ + +burn : test.hex + avrdude -c usbtiny -p $(PROGPART) -V -U flash:w:test.hex + +#For PLL +burnfuses : + avrdude -c usbtiny -p $(PROGPART) -U lfuse:w:0x41:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m + +burnfuses_legacy_timer_1 : + avrdude -c usbtiny -p $(PROGPART) -U lfuse:w:0x53:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m + +burnfuses_default : + avrdude -c usbtiny -p $(PROGPART) -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m + +readfuses : + avrdude -c usbtiny -p $(PROGPART) -U hfuse:r:high.txt:b -U lfuse:r:low.txt:b + +clean : + rm -f *~ high.txt low.txt test.hex test.map test.elf *.o sendpack.S makesendpack -- cgit v1.2.3