Check if atmega is really dead.

Hi,
I have two atmega chips I haven't been using for a few months.
I've managed to flash one succesfully using an arduino as an isp programmer.
However I can't flash the other one, avrdude reports bad signature and using '-F' gives 0x0 fuses. The chip hasn't got a bootloader and I don't remember what are the fuse settings.
How can I know if the problem comes from bad fuses or if the chip is really dead ?

Thanks

Is it possible the "bad" processor is configured to run from a crystal or oscillator resonator?

Yes. I remember switching from internal to external a few times. I may have made a mistake.

Do you have a crystal or resonator connected to the "bad" processor?

If not, you just need to provide a clock signal on the XTAL1 pin. I believe Lady Ada has generously publish an ArduinoISP version that does exactly what you need. Report back if you have trouble finding it.

That's a brilliant idea! I've modified my board programming sketch to output an 8 MHz clock on pin 9, if you happen to need it.

I can't remember if I thought of it independently or read about someone else doing it but I'll take credit for the idea. :smiley:

4 MHz seems to be the most common choice. I use 1 MHz in TinyISP. Honestly, I don't think it makes any difference as long as it's at least 4 times the SPI bitrate.

Pin 9. Excellent choice. That's the same pin I use for TinyISP running on a 328 processor.

Poke it with a stick, see if it moves.

Thanks, but it just happened that way.

const byte CLOCKOUT = 9;

...

  pinMode (CLOCKOUT, OUTPUT);
  
  // set up Timer 1
  TCCR1A = _BV (COM1A0);  // toggle OC1A on Compare Match
  TCCR1B = _BV(WGM12) | _BV(CS10);   // CTC, no prescaling
  OCR1A =  0;       // output every cycle

It happened to be the output for Timer 1. So why shouldn't Timer 1 be working? I am.

Plus we may as well get 8 Mhz out of the thing.

How can I know if the problem comes from bad fuses or if the chip is really dead ?

Try my "fuse settings" calculator:

That was just a bad fuse. Thanks Nick, your fuse calculator worked perfectly using the PWM on pin 9. Using Ladyada's ISP programmer I managed to fix that, and set it to use the internal oscillator.

Thanks.