This is what I ran into for the first time: I was flashing the chip the other day and after many successful runs I encountered the following infamous avrdude error:
… … …
avrdude: Device signature = 0×000000
… … …
Typically when I ran into this problem it was due to loose cable connection and I was able to get past it by reconnecting the ICSP header and try again. But this time, the it seems that no matter how many times I tried the problem remained.
I am pretty sure that chip itself was not damaged as it was sitting in the ICSP board I built all the time and I was able to program it successfully many times minutes before this happened.
Here’s what I have tried and so far had no success:
- rebooted system
- re-seated the IC
- changed -B option to allow more delays
- changed -b option to different baud rates
- tried to use external clock signal from a working ATmega328p
And just to be sure nothing was wrong with either the cable or the board itself, I popped in another ATmega328P and everything worked. So it seems that even though I did not change any fuse settings, and the only command I used was
avrdude -V -F -C avrdude.conf -c duemilanove -p m328p -U flash:w:{hex file})
I guess that somehow the fuse settings had changed and thus the chip stopped responding to the clock signal.
So, it’s time for me to try the high voltage parallel programming method (like this one) to see if my theory was correct.
Following the instructions, I built the shield quickly (not very pretty but serves the purpose nevertheless). The none-standard header spacing was not a big issue as it was easy enough to bend the header pins to achieve the desired spacing (see picture below):
For the high voltage programming enable 12V supply, I chose to use a simply transistor switch instead of the boost converter:
The drawback of this approach is that the output voltage is not as precise and I had to experiment a little bit to obtain the required HV programming voltage The enable signal comes from the Arduino is around 4.5 V which may not be sufficient to put the transistor in the saturated mode and in my case with a 14 Volt supply, I was able to obtain the required 12 V output. Since the control signal is inverted compared to the original schematic in the article, I had to invert all the digitalWrites to the 12V enable pin to make the program work with my version of the shield.
I used the AVR Fuse calculator to obtain the default fuse settings for ATmega328p:
LFuse = 0x62
HFuse = 0xD9
EFuse = 0xFF
And it brought the “bricked” ATmega328p back to life with the first try! So I guess a parallel mode programmer can come in handy in situations like this.