aboutsummaryrefslogtreecommitdiff
path: root/tools/avr_codegen/Makefile
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2016-12-03 21:16:13 -0500
committercnlohr <lohr85@gmail.com>2016-12-03 21:16:13 -0500
commit368f4dcca9f8fdadfee527345b59f7a7ba6d6367 (patch)
treeeaf7b4f4a281cd892dee7159df9ca7b4ff2c7cf8 /tools/avr_codegen/Makefile
parent684b109e8cd3246c93fdec3e63157bbd11bb359a (diff)
downloadlibsurvive-368f4dcca9f8fdadfee527345b59f7a7ba6d6367.tar.gz
libsurvive-368f4dcca9f8fdadfee527345b59f7a7ba6d6367.tar.bz2
Update tools encode a 2.5 MHz signal with the AVR.
Diffstat (limited to 'tools/avr_codegen/Makefile')
-rw-r--r--tools/avr_codegen/Makefile37
1 files changed, 37 insertions, 0 deletions
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