Pages: [1]   Go Down
Author Topic: Check if atmega is really dead.  (Read 1683 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Is it possible the "bad" processor is configured to run from a crystal or oscillator resonator?
« Last Edit: May 08, 2012, 03:07:13 pm by Coding Badly » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 473
Posts: 18695
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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-grin

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.
« Last Edit: May 09, 2012, 03:50:35 pm by Coding Badly » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 26252
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Poke it with a stick, see if it moves.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 473
Posts: 18695
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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


Thanks, but it just happened that way.

Code:

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.

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

Try my "fuse settings" calculator:

http://arduino.cc/forum/index.php?topic=105089
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: