Wiblocks --- Arduino Bootloader

ZB1 Bootloader

The ATmega328 bootloader has not been tested extensively. I finished installing and configuring the tools today (1 January 2009) and got "Hello World" running. YMMV

There are two modifications required to get the standard Arduino bootloader to run on the ZB1

  1. the crystal frequency must be changed to 12MHz.
  2. the LED pin must be changed to Arduino pin 7 (ATmega168 PD7).
The crystal frequency is initialized in the Makefile. The LED pin is set in the file containing bootloader source code.

Arduino Board Name

Using the Arduino Tools->Board menu select the appropriate board name for your bootloader ---
ATmega168   Arduino NG or older w/ ATmega168
ATmega328Arduino Diecimila w/ ATmega328

Burning the Booloader

NB: The ZB1 is powered from 3.3V. Any device that connects to the ZB1 should not place voltages greater than 3.3V on any ZB1 pin. The ICSP header, J6, requires 3.3V TTL levels.

The USBtiny, from adafruit.com, will output 3.3V levels when jumper JP3 removed. After removing JP3 connect the USBtiny six pin receptacle to J6 making sure to allign both pin ones.

After the USBtiny is properly connected type you can burn the bootloader to flash by typing ---
make isp
After successfully burning the flash (for the ATmega168) you should see the following lines ---
avrdude: 16210 bytes of flash written
avrdude: verifying flash memory against ATmegaBOOT_168_zb1.hex:
avrdude: load data flash data from input file ATmegaBOOT_168_zb1.hex:
avrdude: input file ATmegaBOOT_168_zb1.hex auto detected as Intel Hex
avrdude: input file ATmegaBOOT_168_zb1.hex contains 16210 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 30.92s

avrdude: verifying ...
avrdude: 16210 bytes of flash verified
avrdude: reading input file "0x0f"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0f:
avrdude: load data lock data from input file 0x0f:
avrdude: input file 0x0f contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Testing the USB-Tiny (ATmega328 Makefile only)

A couple of targets have been added to the makefile to verify the usb-tiny programmer is communicating with the ATmega IC through the ISP port. With an ATmega328 connected typing make isp-test-328 produced the following output ---
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f

avrdude: safemode: Fuses OK

avrdude done.  Thank you.
With an ATmega168 connected typing make isp-test-328 produced the following output ---
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9406
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.