hackmeister.dk

New bootloader file for ATmega8L

January 16, 2011 | 1 Minute Read

When using the LCD I/O Backpack with the ATmega8L-8AU, you need a bootloader that runs at 8 MHz.

But the one shipping with Arduino for the ATmega8 has some less than ideal settings, most annoyingly a very long startup delay and a low speed for the serial programming.

I have now made a re-compile of the bootloader with these two settings changed (about 1 second startup delay and 19200bps serial speed), which results in faster programming, and a much shorter startup time, both from power-on but also after a soft reset following programming.

All you need, is to download the .hex file and place in in the atmega8 folder under hardware/arduino/bootloaders in the Arduino environment and modify the boards.txt file to include this new bootloader.

On Mac, you have to right-click the Arduino.app and select ‘Show Package Content’ and navigate to Content/Resources/Java/hardware/arduino/bootloaders to find the atmega8 folder.

I have used the following segment in boarts.txt to reference this file in the Arduino environment.

##############################################################

atmega8l.name=LCD I/O Backpack w/ ATmega8L @ 8MHz

atmega8l.upload.protocol=stk500
atmega8l.upload.maximum_size=7168
atmega8l.upload.speed=19200

atmega8l.bootloader.low_fuses=0xdf
atmega8l.bootloader.high_fuses=0xca
atmega8l.bootloader.path=atmega8
atmega8l.bootloader.file=ATmega8L.hex
atmega8l.bootloader.unlock_bits=0x3F
atmega8l.bootloader.lock_bits=0x0F

atmega8l.build.mcu=atmega8
atmega8l.build.f_cpu=8000000L
atmega8l.build.core=arduino
atmega8l.build.variant=standard

##############################################################

Downloads

Below is just the .hex file, zipped up to avoid corruption. The source is the same as the source that comes with the Arduino environment (in the hardware/atmega8 folder) just adjusted to 8MHz and with a timeout of 1000000)

Tip

If you want to compile your own, you might have to use the AVR-GCC compiler from one of the older Arduino enviromnents (I used Arduino-0010 on Mac), since the newer AVR-GCC complains a bit.

Update for users of Arduino 1.0 and later

Ray has notified me about a problem when using the above instructions with Arduino 1.0. The reason for the error he is getting is a change that the Arduino team has made, which my instructions didn’t take into account. I have updated the text you need to add to the boards.txt (added the last settings line), which tells the compiler what pins settings to use, when compiling for the ATmega8L.