From 1e421dd3933f40e87d859739634d97ff12986340 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 26 Nov 2008 14:34:24 +0000 Subject: Setting atmega328 bootloader baud rate to 57600 (for now) and adding isp targets to makefile (e.g. diecimila_isp, atmega328_isp). --- bootloaders/atmega168/Makefile | 122 ++++++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 39 deletions(-) (limited to 'bootloaders/atmega168/Makefile') diff --git a/bootloaders/atmega168/Makefile b/bootloaders/atmega168/Makefile index 884a70c..861cedd 100755 --- a/bootloaders/atmega168/Makefile +++ b/bootloaders/atmega168/Makefile @@ -4,20 +4,17 @@ # # Instructions # -# To build the bootloader for the Diecimila: +# To make bootloader .hex file: # make diecimila -# -# To build the bootloader for the NG/Mini: -# make ng -# -# To build the bootloader for the LilyPad: # make lilypad +# make ng +# etc... # -# To burn the bootloader: -# make TARGET=diecimila isp -# make TARGET=ng isp -# make TARGET=lilypad isp -# make TARGET=pro8 isp +# To burn bootloader .hex file: +# make diecimila_isp +# make lilypad_isp +# make ng_isp +# etc... # program name should not be changed... PROGRAM = ATmegaBOOT_168 @@ -39,11 +36,15 @@ 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: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 + +ISPFUSES = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -P $(ISPPORT) $(ISPSPEED) \ +-e -u -U lock:w:0x3f:m -U efuse:w:0x$(EFUSE):m -U hfuse:w:0x$(HFUSE):m -U lfuse:w:0x$(LFUSE):m +ISPFLASH = avrdude -c $(ISPTOOL) -p $(MCU_TARGET) -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-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 @@ -68,61 +69,104 @@ 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: $(PROGRAM)_lilypad.hex + +lilypad_isp: lilypad +lilypad_isp: TARGET = lilypad +lilypad_isp: HFUSE = DD +lilypad_isp: LFUSE = E2 +lilypad_isp: EFUSE = 00 +lilypad_isp: isp 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 +lilypad_resonator: $(PROGRAM)_lilypad_resonator.hex + +lilypad_resonator_isp: lilypad_resonator +lilypad_resonator_isp: TARGET = lilypad_resonator +lilypad_resonator_isp: HFUSE = DD +lilypad_resonator_isp: LFUSE = C6 +lilypad_resonator_isp: EFUSE = 00 +lilypad_resonator_isp: isp pro8: TARGET = pro_8MHz pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' -pro8: $(PROGRAM)_pro_8MHz.hex pro8: AVR_FREQ = 8000000L -pro8: HFUSE = DD -pro8: LFUSE = C6 +pro8: $(PROGRAM)_pro_8MHz.hex + +pro8_isp: pro8 +pro8_isp: TARGET = pro_8MHz +pro8_isp: HFUSE = DD +pro8_isp: LFUSE = C6 +pro8_isp: EFUSE = 00 +pro8_isp: isp pro16: TARGET = pro_16MHz pro16: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' -pro16: $(PROGRAM)_pro_16MHz.hex pro16: AVR_FREQ = 16000000L -pro16: HFUSE = DD -pro16: LFUSE = C6 +pro16: $(PROGRAM)_pro_16MHz.hex + +pro16_isp: pro16 +pro16_isp: TARGET = pro_16MHz +pro16_isp: HFUSE = DD +pro16_isp: LFUSE = C6 +pro16_isp: EFUSE = 00 +pro16_isp: isp pro20: TARGET = pro_20mhz pro20: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' '-DWATCHDOG_MODS' -pro20: $(PROGRAM)_pro_20mhz.hex pro20: AVR_FREQ = 20000000L -pro20: HFUSE = DD -pro20: LFUSE = C6 +pro20: $(PROGRAM)_pro_20mhz.hex + +pro20_isp: pro20 +pro20_isp: TARGET = pro_20mhz +pro20_isp: HFUSE = DD +pro20_isp: LFUSE = C6 +pro20_isp: EFUSE = 00 +pro20_isp: isp diecimila: TARGET = diecimila diecimila: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -diecimila: $(PROGRAM)_diecimila.hex diecimila: AVR_FREQ = 16000000L -diecimila: HFUSE = DD -diecimila: LFUSE = FF +diecimila: $(PROGRAM)_diecimila.hex + +diecimila_isp: diecimila +diecimila_isp: TARGET = diecimila +diecimila_isp: HFUSE = DD +diecimila_isp: LFUSE = FF +diecimila_isp: EFUSE = 00 +diecimila_isp: isp ng: TARGET = ng ng: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>1' '-DNUM_LED_FLASHES=3' -ng: $(PROGRAM)_ng.hex ng: AVR_FREQ = 16000000L -ng: HFUSE = DD -ng: LFUSE = FF +ng: $(PROGRAM)_ng.hex + +ng_isp: ng +ng_isp: TARGET = ng +ng_isp: HFUSE = DD +ng_isp: LFUSE = FF +ng_isp: EFUSE = 00 +ng_isp: isp atmega328: TARGET = atmega328 -atmega328: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -atmega328: $(PROGRAM)_atmega328.hex -atmega328: AVR_FREQ = 16000000L atmega328: MCU_TARGET = atmega328p +atmega328: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 +atmega328: AVR_FREQ = 16000000L atmega328: LDSECTION = --section-start=.text=0x7800 +atmega328: $(PROGRAM)_atmega328.hex + +atmega328_isp: atmega328 +atmega328_isp: TARGET = atmega328 +atmega328_isp: MCU_TARGET = atmega328p +atmega328_isp: HFUSE = DA +atmega328_isp: LFUSE = FF +atmega328_isp: EFUSE = 05 +atmega328_isp: isp -isp: $(PROGRAM)_$(TARGET).hex +isp: $(TARGET) $(ISPFUSES) $(ISPFLASH) -- cgit v1.2.3-18-g5258