Let's Make Robots!

Burning the Arduino Bootloader with your Arduino as the ISP programmer

I noticed that the Arduino 0018 software included the option of using an existing Arduino as a programmer for burning the bootloader onto blank ATmega chips.Below is my Arduino Nano configured as per the instructions.

This sounds like a great idea but I am having trouble getting it to work in practise. Usually I get this error:

avrdude: Expected signature for ATMEGA8 is 1E 93 07 when trying to program the ATmega8A despite the fact that the datasheet claims that is the signature for the ATmega8A.

I get the same error no matter what chip I try to program.

I am using an Arduino Nano (ATmega168) for the programmer and I have tried programming an ATmega 8A, 168-20AU and a 1280-16AU with no luck. I have also tried using an Arduino Mega as the programmer with similar results :(

I am currently researching different methods of burning the Arduino bootloader onto ATmega8 chips for a new prototype Bi-Ped I am working on. Has anyone used this method successfully?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Ok, I have now re-install the Arduino 0018 enviroment. I have set the target up on a breadboard. I have tried burning the bootloader with both the AVRdude that came with Arduino 0018 and with the latest WinAVR. I no longer get the signature error but regardless of how I connect the target chip it will not program.

I have also tried a few different target IC's (fresh from Atmel) in case one was faulty. So far I suspect the problem is that my programmer is using a different IC to the target IC.

Ok, I have now re-install the Arduino 0018 enviroment. I have set the target up on a breadboard. I have tried burning the bootloader with both the AVRdude that came with Arduino 0018 and with the latest WinAVR. I no longer get the signature error but regardless of how I connect the target chip it will not program.

 

I have used this method to bootload some (fresh) atmega8L chips and it worked like a charm.

I assume you have already checked these things:

1) Verify your target chip using some programmer that has "Autodetect Chip" feature (I use Sinaprog based on AVRdude)

2) select the right board from Tools -> Board (corresponding to your target chip)

3) If still no joy then tweak boards.txt.. maybe try changing  atmega8.build.mcu=atmega8 to atmega8.build.mcu=atmega8a ?

I'm pretty sure that will throw an error but do give it a try..

 

1. Verify your target chip - Why? This defeats the purpose of not using a programmer and I can clearly read the chip. I know what it's signature is because this information is in the datsasheet.

2. Yes I did read all instructions carefully.

3. I created a duplicate of "Arduino NG or older w/ ATmega8" which I called "ATmega8A" so I could experiment with the settings in the boards.txt file. Changing the target data to ATmega8A causes AVRdude to bring up the error "invalid device" at which point it lists valid devices.

As the 8A is identical to the 8 except for the ability to opperate over a wider voltage range there is no difference in the programming method.

 

I have found some instances mentioned on the net where changing the version of AVRdude solved the problem. The instructions included in the sketch (circa February 2009) also suggest using the AVRdude from winAVR.

Unfortunately no one had the good sense to mention exacly what version it was that actually worked. My other problem is that as I am not a programmer I have no idea how to get the Arduino IDE to use a different version of AVRdude.

So far it seems that very few people have got this to work and only by using another (unknown) version of AVRdude. I wish people would document things better :(

Avrdude is just an exe (avrdude.exe) so it should be possible to just replace that exe with different version (never really tried that so it's just a guess).

In WinAVR avrdude lives in directory C:\WinAVR-20090313\bin (of course depending where you installed it). In Arduino avrdude seems to be in C:\arduino-0018\hardware\tools\avr\bin. Just copy the one in WinAVR to Arduino (and keep a backup of the original :-).

I just noticed that avrdude in WinAVR-20090313 doesn't work (I'm pretty sure it worked before but I might be wrong). I installed WinAVR-20100110 and now avrdude works ok. I tested it like this (programmed multiled-sw-pwm-2.hex to ATTiny2313):
avrdude -p attiny2313 -P com8 -c stk500 -e -U flash:w:multiled-sw-pwm-2.hex

I'm using avrUSB500v2 programmer so instead of avrisp I use stk500 as programmer in avrdude.

As a side note: WinAVR has some problems in 64-bit Vista (see for example: http://www.madwizard.org/electronics/articles/winavrvista). This however shouldn't affect avrdude (it works ok on my 64-bit Vista without workarounds).

 

 

You would think that in the first version of the Arduino enviroment to support this option they would include the correct version of AVRdude but at this stage it is the only option I haven't tried and others on the net have suggested that this solves the problem.

As a side note: It was also suggested that for those who want to compile the bootloader for the ATmega8 that the newer software could not compile it to fit within the 1Kb limit. It was suggested to use an older version such as AVRstudio 3.

Ok, it was not the progress I hoped for but I have gone from unexepected signatures to

protocol error, expec=0x14, resp=0x50
initialization failed, rc=-1

This was using the Arduino Mega as the programmer and AVRdude from WinAVR 20100110. I get the same result with the target chip in my prototype robot and in a Arduino PCB. Both have 16MHz crystal oscilators.

P.S. I'm using Windows XP. So far I have not read about any problems relating to this opperating system.

Hi Oddbot, it says expected signature is 1E 93 07 because that`s what the atmega8a is. Obviously either the chip you have is different or it isn`t communicating properly. Does the program tell you what chip signature is being returned?