[solved]atmega8 standalone breadboard slow 10 sec startup bootloader delay

Finally got my atmega8 chip working on my breadboard. I notice one thing, and that's the startup time is very slow. I uploaded a led blinker code to it, and it will start blinking the led after about 10 sec. Normally it is fine, but for my project, I need to frequently switch on/off this chip, and 10 sec start up is too long for me.

this is the board I pick when uploading the bootloader using my uno as ISP, and I am using 1.0.5.


solved using optiboot; unzip everything, and copy it to the IDE hardware folder, Done!! startup time is less than 2 sec now. great!

NG or older w/ ATmega8

atmega8.upload.protocol=arduino
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT-prod-firmware-2009-11-07.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino
atmega8.build.variant=standard

optiboot-v5.0a.zip (199 KB)

I'm not sure about it, but I think it was like this: The ATmega8 NG board doesn't have DTR connected to the reset, so you have 10 seconds to press the reset button yourself when uploading a sketch. You can create a new OptiBoot bootloader without that delay. When you do, you have to add a new version to boards.txt.

The OptiBoot is also smaller, you can make the boot section smaller, and have more for your code :stuck_out_tongue:

Peter_n:
I'm not sure about it, but I think it was like this: The ATmega8 NG board doesn't have DTR connected to the reset, so you have 10 seconds to press the reset button yourself when uploading a sketch. You can create a new OptiBoot bootloader without that delay. When you do, you have to add a new version to boards.txt.

The OptiBoot is also smaller, you can make the boot section smaller, and have more for your code :stuck_out_tongue:

can you show me how it's done?

OptiBoot: Google Code Archive - Long-term storage for Google Code Project Hosting.
Let's try the 5.0a version.
Add it to the Arduino software, see bootloader/optiboot/README.TXT
Open a command window, and go to the optiboot directory. Run the make file with options (I think).
There are options to select the chip, the serial port and so on. I can't find it right now. Ask me again when you don't know what to do, perhaps I have it on my other computer how I created a bootloader with it.

Have a look at the long thread of optiboot: New optiboot; beta testers welcome... - Microcontrollers - Arduino Forum

Peter_n:
OptiBoot: Google Code Archive - Long-term storage for Google Code Project Hosting.
Let's try the 5.0a version.
Add it to the Arduino software, see bootloader/optiboot/README.TXT
Open a command window, and go to the optiboot directory. Run the make file with options (I think).
There are options to select the chip, the serial port and so on. I can't find it right now. Ask me again when you don't know what to do, perhaps I have it on my other computer how I created a bootloader with it.

Have a look at the long thread of optiboot: New optiboot; beta testers welcome... - Microcontrollers - Arduino Forum

confused. The instruction is not noob proof. They need to have step to step instructions for everything. I saw there is an optiboot folder already in my hardware\arduino\bootloaders. Trying everything, nothing shows up in my Tools > Board. This optiboot maybe great, but it's definitely not beginner friendly.

Uploading via ISP with external programmer is much faster than uploading via bootloader and the sketch starts right on.

mart256:
Uploading via ISP with external programmer is much faster than uploading via bootloader and the sketch starts right on.

I know how to use my uno to burn a bootloader to my atmega8. For external programmer, can I use my uno as well? do I need to erase the bootloader of my atmega8?

http://arduino.cc/en/Tutorial/ArduinoISP

Yea. Uno can be used as external isp programmer. Dont worry about bootloader because it is going to be erased automatically when you upload a sketch via isp. And you get the extra space ;D

mart256:
Yea. Uno can be used as external isp programmer. Dont worry about bootloader because it is going to be erased automatically when you upload a sketch via isp. And you get the extra space ;D

the code got uploaded, but it gave me errors and the startup is same thing, slow.

Binary sketch size: 890 bytes (of a 7,168 byte maximum)
avrdude: verification error, first mismatch at byte 0x00d2
         0x66 != 0x60
avrdude: verification error; content mismatch

arduinomagbit:

mart256:
Yea. Uno can be used as external isp programmer. Dont worry about bootloader because it is going to be erased automatically when you upload a sketch via isp. And you get the extra space ;D

the code got uploaded, but it gave me errors and the startup is same thing, slow.

Binary sketch size: 890 bytes (of a 7,168 byte maximum)

avrdude: verification error, first mismatch at byte 0x00d2
        0x66 != 0x60
avrdude: verification error; content mismatch

That means arduino IDE is not erasing before uploading, and bootloader is still messing with the new sketch, thats why the mismatch. Maybe there's an option on IDE to command a proper erase before every upload.

I use avrdude commands on console when I use avr programmers, I dont like arduino IDE to that task. Download winavr if you have windows. There's a short and easy tutorial of avrdude on ladyada.
When upload via avr dude memory gets erased first. Theres an option to only erase chip too.

mart256:

arduinomagbit:

mart256:
Yea. Uno can be used as external isp programmer. Dont worry about bootloader because it is going to be erased automatically when you upload a sketch via isp. And you get the extra space ;D

the code got uploaded, but it gave me errors and the startup is same thing, slow.

Binary sketch size: 890 bytes (of a 7,168 byte maximum)

avrdude: verification error, first mismatch at byte 0x00d2
        0x66 != 0x60
avrdude: verification error; content mismatch

That means arduino IDE is not erasing before uploading, and bootloader is still messing with the new sketch, thats why the mismatch. Maybe there's an option on IDE to command a proper erase before every upload.

I use avrdude commands on console when I use avr programmers, I dont like arduino IDE to that task. Download winavr if you have windows. There's a short and easy tutorial of avrdude on ladyada.
When upload via avr dude memory gets erased first. Theres an option to only erase chip too.

Thanks for the tips. I went back to optiboot, finally have it working out. startup is quick now, about 1 sec.

arduinomagbit:
Finally got my atmega8 chip working on my breadboard. I notice one thing, and that's the startup time is very slow. I uploaded a led blinker code to it, and it will start blinking the led after about 10 sec. Normally it is fine, but for my project, I need to frequently switch on/off this chip, and 10 sec start up is too long for me.

this is the board I pick when uploading the bootloader using my uno as ISP, and I am using 1.0.5.


solved using optiboot; unzip everything, and copy it to the IDE hardware folder, Done!! startup time is less than 2 sec now. great!

NG or older w/ ATmega8

atmega8.upload.protocol=arduino
atmega8.upload.maximum_size=7168
atmega8.upload.speed=19200

atmega8.bootloader.low_fuses=0xdf
atmega8.bootloader.high_fuses=0xca
atmega8.bootloader.path=atmega8
atmega8.bootloader.file=ATmegaBOOT-prod-firmware-2009-11-07.hex
atmega8.bootloader.unlock_bits=0x3F
atmega8.bootloader.lock_bits=0x0F

atmega8.build.mcu=atmega8
atmega8.build.f_cpu=16000000L
atmega8.build.core=arduino
atmega8.build.variant=standard

Very good. Well done.

Did you use one of the prebuild bootloaders ?
When you write a sketch with a programmer (or Arduino as ISP), the bootloader is removed and startup time is even faster.

Peter_n:
Very good. Well done.

Did you use one of the prebuild bootloaders ?
When you write a sketch with a programmer (or Arduino as ISP), the bootloader is removed and startup time is even faster.

doesn't work with me uploading with my uno as an ISP, startup time is still slow. I didn't do anything, just downloaded the zip, unzipped, and copied everything to the hardware folder, and it works.