Is my ATMEGA328-PU dead or bricked?

I bought an ATMEGA328-PU (non-pico) and while boot-loading it on a breadboard with arduino I bricked/damaged it.
Schematics is shown in arduino. I do not exactly remember what steps I took to brick it, or is actually bricked or dead.
I use an old computer smps for power supply. Just shorting the green and black wires starts the smps.
But it gives 10-11 volt instead of 12V and 5.56 to 6V instead of 5V. I was trying to boot-load with arduino and using this PSU. I tried to save a few buck and did not use a LM7805. May be higher voltage killed my chip or trying to burn a wrong boot-loader bricked it.
Then I had to buy another at 150 Indian Rupees (nearly 2.347 US Dollar).
After searching a lot I realized I should set the proper fuse bits first and I created two Batch files. Please download the attachments.

After that I modified the boards.txt.

First setting the fuse-bits then burning the boot-loader with this modified board worked fine on the second uC that I had to buy.

Now I need to recover some loss of 150 INR. And only I can do that if I can recover my dead/bricked uC.

I tried a High Voltage Programmer as described in the forum Arduino-based AVR High Voltage Programmer | MightyOhm and also here, both are same though.

I wrote the appropriate fuse bit in the .pde file provided as:

// Desired fuse configuration
#define  HFUSE  0xD9   // Default for ATMEGA328-PU
#define  LFUSE  0x62

compiled and uploaded the code to the working atmega328-pu using it as the doctor chip. Everything went fine. The red led turned on, I pressed the button, led went off for a while then turned on again.
I thought it is repaired, but not.
Again I tried to set the fuse with the batch file and got the same message:

C:\Users\******\Desktop>avrdude -c stk500v1 -p m328 -P COM3 -b 19200 -U lfuse:
w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.08s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.08s

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


avrdude done.  Thank you.

The I added -F parameter to the batch file and got:

C:\Users\********\Desktop>avrdude -F -c stk500v1 -p m328 -P COM3 -b 19200 -U lfu
se:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0x05:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.08s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATmega328 is 1E 95 14
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing |                                                    | 0% 0.00s ***faile
d;
Writing | ################################################## | 100% 0.16s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0xff
avrdude: verification error; content mismatch

avrdude: safemode: lfuse changed! Was ff, and is now 0
Would you like this fuse to be changed back? [y/n]

Suddenly I guessed my smps is not supplying 12V, so I took power from white (-5V) as GND and yellow(+12V) as Vcc. Tried again, no hope..

Then I modified the pde file and also renamed the extension to .ino.

Tried again. Observed all the gimmickry of the HVSP. Though it has been repaired.
No. Not at all.

I think HVSP is working because it is following the action sequence of lighting up-glowing off-lighting up again, at the right time.
So my chip may be faulty or dead somehow.

How do I know whether it is dead or locked? Any other resort to recover it with the basic components I have at home?

boards(ATMEGA328-PU).txt (1.14 KB)

hvfusemodified.ino (5.64 KB)

arduinos avr environment.bat.txt (100 Bytes)

setfuse_ATMEGA328dashPU.BAT.txt (100 Bytes)

So, you used high voltage programming to restore the bad chip.

Connect your good known working 328 and do the avrdude command to read the info about the chip. You do this by using the -v option and omit the -U options.

avrdude -F -c stk500v1 -p m328 -P COM3 -b 19200 -v

It should show you a signature of something other than 0x000000 and show you the fuse settings.

Leave the same wiring in place, just removing the good 328 and replacing with the bad 328. Repeat the avrdude command to read the chip. If you still get signature 0x000000, I feel your bad 328 is burned out.

Sorry, its a little bit late. Its rainy season in my country. Due to bad network I could not connect to the internet. However 'Better late, than never'.

I did try it. It gives an output as:

C:\Users\*******\Desktop>avrdude -F -c stk500v1 -p m328 -P COM3 -b 19200 -v

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardw
are\tools\avr\bin\avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  36
00 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.08s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATmega328 is 1E 95 14
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (H:00, E:00, L:00)

avrdude done.  Thank you.

However I did not understand what it is all about. Its all Chinese to me.
Is my ATMEGA dead or alive?

You tried this with the ATmega328 which you know is good, and in the line near the bottom where it gives the device signatures and fuses it gave non-zero values, right? And then you repeated the process with the suspected bad ATmega328 and got the results you posted. Do I understand that correctly?

No, it is the bad chip that gave the result.

Good one is producing something different as follows:

C:\Users\*******\Desktop>avrdude -F -c stk500v1 -p m328 -P COM3 -b 19200 -v

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardw
are\tools\avr\bin\avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  36
00 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  45
00 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.08s

avrdude: Device signature = 0x1e9514
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DE
avrdude: safemode: efuse reads as 5
avrdude: safemode: Fuses OK (H:05, E:DE, L:FF)

avrdude done.  Thank you.

Ok. The purpose of checking the good chip is to make sure your programmer circuit works well. Since you used high voltage programming to attempt to restore the bad chip and it still shows no good device signature, I think it is dead.

First, So Many Thanks for the time you invested for my problem.

Now I have come to the conclusion that my chip is dead.

So we need to come to a conclusion that AVR chips cannot sustain at any higher voltage than 5.5V as mentioned in its datasheet. It is always safer to stay in between 4.3V to 5.1V.
Although lower voltage will not cause any harm to the controller but it may not work properly.
I tested 2 Energizer Alkaline battery rejected from my Nikon SB 600 Flashgun. Each of which shown 1.4V totaling 2.8V. Atmega at this voltage will not boot even. But it caused no damage to the uC. Minimum required voltage from my own experience is 4.5V. Maximum is 5.1V, only to be safe.
A LM7805 and LM7812 costs here Rs. 5/- and Rs. 12/- respectively, assuming One USD = 64.09 Indian Rupees as on today. A 220uF Electrolytic cap costs Rs. 2/- and a 100nF Ceramic Cap costs Rs. 1/-, an IN4007 costs also Rs. 1.50/-. There is no reason to save Rs. 5 + 2 + 1 + 1.50 = Rs. 9.50/- just to save the voltage regulation cost, as it would cost me more than Rs. 150.00/- to replace a damaged uC.

For the first time I set up this ATMEGA on a bread-board, I fed it a direct supply from the SMPS with Black (universal GND) and Red (+5V) terminals, I guess that caused the damage, since the SMPS is giving near to 6V instead of 5V.

It was solely my foolishness I admit.

I hope this lesson will teach everyone else who uses arduino and AVR in the future.
Thanks again.

I like to use a step down module like this
http://www.ebay.com/itm/1pcs-High-quality-LM2596S-Power-DC-DC-Buck-Converter-Step-Down-Module-5V-3A-L5YP-/221835504353?pt=LH_DefaultDomain_0&hash=item33a66d2ae1

I can input 9 to 12VDC or even higher into it such as from a power supply or battery, and just adjust it to 5.0 volts or whatever other voltage I want. It is common to use ATmega328P at 3.3V.

Thanks for the Ebay link.
But I wonder how can this stuff be so cheaper. If I wish to build this module in India this might cost more than 1.2-1.8 USD. Also this product does not ships to India.
One question again: You mentioned Atmega can run at 3.3V, I did not test it though.
I think if you use ADC/DAC of Atmega with a sensor that produces any analog reading then It would be better to feed it 5V instead of 3.3V since our AVRs have a 10-bit analog resolution means 0 to 1023 steps of voltage reading. For 5V, each step will be 5/1024=0.0049V and the same will be 3.3/1024=0.0032227V, much less. At lower voltage AVRs performance also becomes daunting. I do not have any idea but I heard that in case of a data-logger device made up with AVRs they might corrupt or inaccurately log some data at lower voltage although will not be damaged at any cost.

Now I need an honest advice.
How would be an LM317 to construct a variable regulator. I know this is not cheap and efficient but considering the current consumed by AVR, sensor, display, transistors this may serve the purpose. LM317 costs here Rs. 15-20. Things are not cheap in India, that's the problem here. But I'm planning to build one. How about this? I am currently using LM7805 is it a good way to do that or there may be a better solution?

Oh, you are right. My LM7805 with a IN4007 at the input produces 3.32V-4.85V, supply provided 5.56V and 10.78V respectively. I measured it now. So AVRs can run at 3.3V and it is usual. But I guess higher voltage (of course less than 5.1V) produces better analog reading. Thanks.

The 328 can run at as low as 1.8v, but only at lower clock speed. 3.3 is good for like 12 out so per specs, but people say they often work fine at 16@3.3.

The fuses can be set to use brown out detect (bod), and the Arduino boards are typically set like this. This must be adjusted to run at lower voltage.

You should be able to get away with over 5.5v without instantly trashing the chip; at least 5.56 I would expect to be okay (I've heard of overclocky people doing 6.xv . I suspect something else went wrong.

I suspect something else went wrong.

Yes, I also think so. First I tried to use my R3 board as ISP to upload codes to standalone atmega328 with Code::Blocks Arduino IDE. I thought it would be better than our IDE. But later discovered it ships an older avr-gcc with older avrdude. That avrdude even does not know ATMEGA328-PU other than the regular one (ATMEGA328P-PU). May be that crashed the chip.

But from now on I will never use anything else other than the official Arduino IDE as Arduino knows Arduino better. But for coding gVim is my first choice and will be. For compilation and upload Arduino IDE. I wish our IDE gets a better command-line interface so that we can integrate it with a vim script. That's all we need now.