aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/atmega168/Makefile
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2008-08-16 01:56:41 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2008-08-16 01:56:41 +0000
commit3460189d097869d3ac10589f18ad28bbde50bd6f (patch)
tree8d84fda64dc056c0e08bba3b963cec1a4c154082 /bootloaders/atmega168/Makefile
parenteac2983285b4bc40250771fb5141aa63c76a9a90 (diff)
Adding Nano and Pro (8 MHz) to boards.txt file; updating Makefile for atmega168 bootloader based on Nathan's changes to allow for customizing of more parameters per-board; including Pro 8 MHz .hex compiled bootloader file; not updating the Diecimila or NG .hex files.
Diffstat (limited to 'bootloaders/atmega168/Makefile')
-rwxr-xr-xbootloaders/atmega168/Makefile59
1 files changed, 53 insertions, 6 deletions
diff --git a/bootloaders/atmega168/Makefile b/bootloaders/atmega168/Makefile
index 669879b..6be8dbe 100755
--- a/bootloaders/atmega168/Makefile
+++ b/bootloaders/atmega168/Makefile
@@ -1,7 +1,7 @@
# Makefile for ATmegaBOOT
# E.Lins, 18.7.2005
# $Id$
-
+#
# Instructions
#
# To build the bootloader for the Diecimila:
@@ -10,16 +10,18 @@
# To build the bootloader for the NG/Mini:
# make ng
#
+# To build the bootloader for the LilyPad:
+# make lilypad
+#
# To burn the bootloader:
# make TARGET=diecimila isp
# make TARGET=ng isp
+# make TARGET=lilypad isp
+# make TARGET=pro8 isp
# program name should not be changed...
PROGRAM = ATmegaBOOT_168
-# enter the target CPU frequency
-AVR_FREQ = 16000000L
-
# enter the parameters for the avrdude isp tool
ISPTOOL = stk500v2
ISPPORT = usb
@@ -37,9 +39,13 @@ LDSECTION = --section-start=.text=0x3800
# unlock the bootloader section) and 0xcf instead of 0x0f (to
# lock it), but since the high two bits of the lock byte are
# unused, avrdude would get confused.
-ISPFUSES = avrdude -c $(ISPTOOL) -p m168 -P $(ISPPORT) $(ISPSPEED) -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdd:m -U lfuse:w:0xff:m
+ISPFUSES = avrdude -c $(ISPTOOL) -p m168 -P $(ISPPORT) $(ISPSPEED) -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m
ISPFLASH = avrdude -c $(ISPTOOL) -p m168 -P $(ISPPORT) $(ISPSPEED) -U flash:w:$(PROGRAM)_$(TARGET).hex -U lock:w:0x0f:m
+STK500 = "C:\Program Files\Atmel\AVR Tools\STK500\Stk500.exe"
+STK500-1 = $(STK500) -e -d$(MCU_TARGET) -pf -vf -if$(PROGRAM)_$(TARGET).hex -lFF -LFF -f$(HFUSE)$(LFUSE) -EF8 -ms -q -cUSB -I200kHz -s -wt
+STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt
+
OBJ = $(PROGRAM).o
OPTIMIZE = -O2
@@ -49,7 +55,6 @@ LIBS =
CC = avr-gcc
-
# Override is only needed by avr-lib build system.
override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(AVR_FREQ) $(DEFS)
@@ -61,18 +66,59 @@ OBJDUMP = avr-objdump
all:
+lilypad: TARGET = lilypad
+lilypad: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3'
+lilypad: $(PROGRAM)_lilypad.hex
+lilypad: AVR_FREQ = 8000000L
+lilypad: HFUSE = DD
+lilypad: LFUSE = E2
+
+lilypad_resonator: TARGET = lilypad_resonator
+lilypad_resonator: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=3'
+lilypad_resonator: $(PROGRAM)_lilypad_resonator.hex
+lilypad_resonator: AVR_FREQ = 8000000L
+lilypad_resonator: HFUSE = DD
+lilypad_resonator: LFUSE = C6
+
+pro8: TARGET = pro_8MHz
+pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1'
+pro8: $(PROGRAM)_pro_8MHz.hex
+pro8: AVR_FREQ = 8000000L
+pro8: HFUSE = DD
+pro8: LFUSE = C6
+
+pro16: TARGET = pro_16MHz
+pro16: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1'
+pro16: $(PROGRAM)_pro_16MHz.hex
+pro16: AVR_FREQ = 16000000L
+pro16: HFUSE = DD
+pro16: LFUSE = C6
+
+pro20: TARGET = pro_20mhz
+pro20: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1'
+pro20: $(PROGRAM)_pro_20mhz.hex
+pro20: AVR_FREQ = 20000000L
+pro20: HFUSE = DD
+pro20: LFUSE = C6
+
diecimila: TARGET = diecimila
diecimila: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1'
diecimila: $(PROGRAM)_diecimila.hex
+diecimila: AVR_FREQ = 16000000L
ng: TARGET = ng
ng: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3'
ng: $(PROGRAM)_ng.hex
+ng: AVR_FREQ = 16000000L
isp: $(PROGRAM)_$(TARGET).hex
$(ISPFUSES)
$(ISPFLASH)
+isp-stk500: $(PROGRAM)_$(TARGET).hex
+ $(STK500-1)
+ $(STK500-2)
+
%.elf: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
@@ -90,3 +136,4 @@ clean:
%.bin: %.elf
$(OBJCOPY) -j .text -j .data -O binary $< $@
+