Is Arduino "bricking" ATmega8?

I was trying to make use of my old ATmega8 chips which were abandoned for a long time. I setup Arduino Uno as a programmer but the only thing I got back was:

avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.

I tried few chips with the same result and then by accident I discovered something strange. New chips will have a nice signature:

D:\programs\arduino-1.0.3\hardware\tools\avr\bin>avrdude.exe -pm8 -carduino -P c om4 -b 19200 -t

avrdude.exe: AVR device initialized and ready to accept instructions

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

avrdude.exe: Device signature = 0x1e9307 avrdude> exit

But if I run "Burn Bootloader" and recieve my Yikes message then the signature is gone.

D:\programs\arduino-1.0.3\hardware\tools\avr\bin>avrdude.exe -pm8 -carduino -P c om4 -b 19200 -t

avrdude.exe: AVR device initialized and ready to accept instructions

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

avrdude.exe: Device signature = 0x000000 avrdude.exe: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.

Can I restore the signature in my "broken" chips? Is there any way to upload sketch to Atmega8 without breaking it?

How did you disable auto-reset? Resistor? Capacitor?

Your bootloader is probably changing the fuses to expect a crystal or something like that.

My bootloader programmer here should be able to recover:

http://www.gammon.com.au/forum/?id=11635

Or supply a clock input (that sketch outputs one on D9).

[quote author=Coding Badly link=topic=138687.msg1041739#msg1041739 date=1356212672]

How did you disable auto-reset? Resistor? Capacitor? [/quote]

I'm not sure is this what you are asking me but I use 10uF capacitor from reset to ground.

I'm not sure is this what you are asking me but I use 10uF capacitor from reset to ground.

Perfect.

What is the end goal? To install a bootloader (e.g. Optiboot)? To upload a sketch?

[quote author=Coding Badly link=topic=138687.msg1042003#msg1042003 date=1356233029]

I'm not sure is this what you are asking me but I use 10uF capacitor from reset to ground.

Perfect.

What is the end goal? To install a bootloader (e.g. Optiboot)? To upload a sketch?

[/quote]

The goal is to upload a sketch.

ps. I think I know why you asked this question. I should be doing UPLOAD SKETCH instead of burning bootloaders ;-) I will give it a go.

Ok I've tried to upload a sketch to ATmega8-16PU Today. The settings I've chosen are:

Board > Arduino NG or older w/ ATmega8 Programmer > Arduino as ISP

and I get this:

avrdude: verification error, first mismatch at byte 0x0000 0x3f != 0x01 avrdude: verification error; content mismatch

ps.

I checked a different chip. Upload works for the first time (well... it didn't return any error). Any following upload results with: avrdude: verification error, first mismatch at byte 0x0378 0x02 != 0x00 avrdude: verification error; content mismatch

lukeuk: and I get this

When you do what? File / Upload Using Programmer? File / Upload?

lukeuk: Can I restore the signature in my "broken" chips? Is there any way to upload sketch to Atmega8 without breaking it?

There is nothing to restore, because the signatures are still there. The only thing that's changed is that you have set the fuses so avrdude can't communicate with the chip, almost certainly because there is now a mismatch between the clock source you have made available to the chips and the clock source the chips are expecting because of their (new) fuse settings after burning the bootloader.

The chips come from the factory set to run at 1MHz from the internal oscillator as the clock source. Arduino boards have external xtals as their clock source, so I would expect the bootloader fuse setting for the old Arduino 8 boards to specify that.

So, you have to figure out how to supply the external clock in order to enable avrdude to communicate with them, and thereby set the fuses back to some setting that matches the clock you intend to run these off.

Which is what, by the way? I assume you are programming these chips on a breadboard without an external xtal. Is that also how you plan to run these in your project (i.e., no external xtal?)

Have a look at the atmega8 datasheet from the Atmel site. It gives a complete description of the various clock options and the corresponding fuse settings.

I like the USBasp as an external programmer with avrdude. The "slow clock" jumper usually provides the get out of jail free card for situations when the chip is being uncommunicative. They are only $5-$10 on ebay -- neater and less fussing around than setting up an Uno as an ISP or whatever if you are going to be doing this more than very occasionally. If that fails, I now have an AVR Dragon for HV programming. If that doesn't work, I give up, say a little prayer, and and commend the chip's soul to Silicon Heaven.