Avrdude refuses to flash ATmega328p due to wrong signature

arduinoatmegaflashicsp

I have a bunch of defunct arduino boards that I'm trying to restore – Arduino Uno with ATmega328p chips. They do not respond to the usual flashing commands, so I'm trying to flash via the arduino ICSP headers, through an intermediate bus pirate.

The process fails due to an invalid signature, like so:

$ avrdude -c buspirate -P /dev/buspirate -p m328p -v -F

avrdude: Version 6.0.1, compiled on Sep 21 2013 at 11:40:49

         Using Port                    : /dev/buspirate
         Using Programmer              : buspirate
         AVR Part                      : ATmega328P
         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  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 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 : BusPirate
         Description     : The Bus Pirate

Attempting to initiate BusPirate binary mode...
BusPirate binmode version: 1
BusPirate SPI version: 1
avrdude: Paged flash write enabled.
AVR Extended Commands not found.
avrdude: initialization failed, rc=-2
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x881608
avrdude: Expected signature for ATmega328P is 1E 95 0F
BusPirate is back in the text mode

avrdude done.  Thank you.

(this is just running -v but trying to set fuses or flash fails the same way)

Weird thing is that the device signature changes slightly on each attempt, so something is definitely not behaving correctly.

I tried the same process by hooking up to the atmega328p pins directly (and not via arduino board ICSP header pins), but with no success.

Is there any salvaging the atmega328p or is it beyond repair?

Best Answer

You need to put an external oscillator. I suppose that the fuses for those chips are programmed for a external oscillator. Once you can flash it with the external oscillator change the fuses so you can program it without an oscillator.