Wednesday, February 10, 2010

SharkBoot (Arbitrary clock speed)

To save batteries, Anool are considering running the SharkFin at 3.3V with a 12 MHz resonator.  That means that the bootloader needs to be recompiled with the new CPU speed.

Steps:
1. Download Makefile from ladyada.net here.
2. Add new target by modifying adaboot328 to Makefile (I called it sharkfin328)

sharkfin328: TARGET = sharkfin328
sharkfin328: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>2' '-DNUM_LED_FLASHES=3'  '-DWATCHDOG_MODS'
sharkfin328: $(PROGRAM)_sharkfin328.hex
sharkfin328: AVR_FREQ = 12000000L 
sharkfin328: MCU_TARGET = atmega328p
sharkfin328: LDSECTION  = --section-start=.text=0x7800

3. >make sharkfin328
4. Upload  see here for details.

The new board will look like a "Arduino Duemilanove or Nano w/ ATmega328" inside of Arduino.

No comments: