# Atmega was loose during programming, now target doesn't answer, and device signature keeps changing

I'am using an atmega328p with a custom build programming board connected to an usbasp. While programming with arvdude, the atmega chip was not perfectly placed in the board header, and the atmega stopped answering after that. This has happened with three atmegas. The board has a 16MHz crystal, and the capacitors. Also, when I force avrdude, it always shows a different device signature.

sudo avrdude -c usbasp -p m328p -v -v -v gives the following output

     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
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
Block Poll               Page                       Polled
Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00


I've also tried to power the atmega with negative reset, but this also didn't work.

Does anyone have any ideas to try and fix this?

First, you need to figure out what the problem is, then you may able to find a solution. you need to make sure that the ic is not bad, by say, putting it into another board. If the IC is okay, but it still doesn't work, then It could be the problem originate from the board. Last but not least, avrdude is not the best software out there. Try to find another easier to use program.

Try high-voltage programming (see section 28.7 in the datasheet). There are ways you can use an existing Arduino as a high-voltage AVR programmer. You should be able to reset the fuses and load a simple program.

If high-voltage programming doesn't work, it's probably used up and you should simply buy a new one.