AVR tests
authorTomas Mudrunka <tomas@mudrunka.cz>
Tue, 11 Feb 2014 01:11:27 +0000 (02:11 +0100)
committerTomas Mudrunka <tomas@mudrunka.cz>
Tue, 11 Feb 2014 01:11:27 +0000 (02:11 +0100)
avr/blink/Makefile
avr/blink/helloworld2 [new file with mode: 0755]
avr/blink/helloworld2.c

index 67cc2f7a2e96b5cab5c014380d584d32b1244b52..03501d526cba97f6f2b6d5b453bb8d775f85e5bc 100644 (file)
@@ -1,9 +1,10 @@
 #MCU=at90s2313
 MCU=attiny2313
+#FUSES=-U lfuse:w:0x64:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
 PORT=/dev/ttyUSB0
 CC=avr-gcc
 OBJCOPY=avr-objcopy
-PROJECT=helloworld
+PROJECT=helloworld2
 RESET=false
 # optimize for size:
 CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues
@@ -22,7 +23,7 @@ asm : $(PROJECT).c
 # load (program) the software into the eeprom:
 load: $(PROJECT).hex
        $(RESET) && stty -F $(PORT) 19200 hupcl && sleep 2 && stty -F $(PORT) 19200 -hupcl && sleep 2 || true
-       avrdude -cstk500v1 -P$(PORT) -b19200 -p $(MCU) -Uflash:w:$(PROJECT).hex:i || $(MAKE) RESET=true MAKE=true load
+       avrdude -cstk500v1 -P$(PORT) -b19200 -p $(MCU) -Uflash:w:$(PROJECT).hex:i $(FUSES) || $(MAKE) RESET=true MAKE=true load
        # uisp -dlpt=/dev/parport0 --erase --upload --verify if=$(PROJECT).hex -dprog=dapa  -v=3 --hash=12
 #-------------------
 clean:
diff --git a/avr/blink/helloworld2 b/avr/blink/helloworld2
new file mode 100755 (executable)
index 0000000..ce27d62
Binary files /dev/null and b/avr/blink/helloworld2 differ
index 1b9520f3673121b5b3279b5cac331e6b7d5b954e..eb67eb6495a3d1e46b1682b5a9a9cf5305a08f77 100644 (file)
@@ -1,3 +1,5 @@
+#define F_CPU 100000000UL // Sets up the default speed for delay.h
+
 #include <avr/io.h>
 #include <util/delay.h>
 
This page took 0.170305 seconds and 4 git commands to generate.