Unbricking Atmel atmega328p (smd soldered on board)

Hi everyone!

Is there a way to unbrick/reprogram an atmega328p smd chip in board without unsoldering it?
I have bricked couple of boards when I lost power during programming with USB ASP 2.0 or I forget to plug it in beforehand. While programming I used external power supply, as I was afraid that supplying power from UAS ASP2.0 wouldn't deliver enough power or interfere with LM7805 and cause problems.

My SPI and UART ports are without devices/elements connected to them, as I use them only for programming.

Does anyone have some solution or have dealt with same probelm before.

Thank you.

It is most likely that you will need to remove the chip from the circuit and use a high-voltage parallel programmer to erase the chip, if it is a firmware problem that can be fixed.

In my custom circuits, I seperate all circuit voltages going to pins 7,20,21 and supplying the pullup resistor on pin 1, with a Schottky diode to prevent all other parts of my circuit from being fed voltage from my USBasp.

did you try again the ISP on ‘bricked’ boards?

I get this reply from avrdude when I try to upload it again:

avrdude.exe: set SCK frequency to 93750 Hz
avrdude.exe: error: programm enable: target doesn't answer. 1
avrdude.exe: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Provide more details about your steps. Post the command you’ve used and also some schematics. Are you using external crystal? As was written, parallel programing could solve the problem but if it is just e.g. missing clock signal it can be solved easily. Are you sure that the power is correct now? What was wrong specifically?

GregOpti:
So if I understand parallel programming couldn't be done with uC on the board?

A high-voltage parallel programmer operates at 12 volts, I believe. It's recommended to remove it from the circuit to prevent damage to the microcontroller, the circuit or the programmer.

I’m using external xtal.

example of firmware upload:
avrdude -c usbasp -p m328p -P usb -B 8.0 -U flash:w:“C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders\atmega\ATmegaBOOT_168_atmega328.hex”:a

In attachement there is uC with spi and uart ports. (I’ve erased irelavant parts)

So if I understand parallel programming couldn’t be done with uC on the board?

GregOpti:
Hi everyone!

Is there a way to unbrick/reprogram an atmega328p smd chip in board without unsoldering it?
I have bricked couple of boards when I lost power during programming with USB ASP 2.0 or I forget to plug it in beforehand. While programming I used external power supply, as I was afraid that supplying power from UAS ASP2.0 wouldn't deliver enough power or interfere with LM7805 and cause problems.

My SPI and UART ports are without devices/elements connected to them, as I use them only for programming.

Does anyone have some solution or have dealt with same probelm before.

Thank you.

Take a look at (and buy) this:

(click pic for link)

Then, just connect the HV programming pins from the programmer shield to the appropriate pins on your 328 board.

I've done this to rescue MEGA2560 boards that I accidentally bricked by disabling the SPI port.

The shield is also handy just for un-bricking DIP package AVR's as well.

I have two of them... one with the sockets soldered in and one "bare" with just 0.025 pins to connect to anything I want. It's saved me a few times.

GregOpti:
I'm using external xtal.

example of firmware upload:
avrdude -c usbasp -p m328p -P usb -B 8.0 -U flash:w:"C:\Program Files (x86)\Arduino\hardware\arduino\avr\bootloaders\atmega\ATmegaBOOT_168_atmega328.hex":a

In attachement there is uC with spi and uart ports. (I've erased irelavant parts)

So if I understand parallel programming couldn't be done with uC on the board?

The "a" should be "i" (for Intel HEX).

As I understand it, the 12 volts for the high voltage parallel programmer is only on the reset pin. If there is a pullup resistor, you'd have to remove that to isolate the reset pin during high voltage programming.
However, that leaves you still with the problem of connecting about 22 pins to the parallel programmer, and some of your existing connections may anyway interfere with the parallel programming.

Maybe de-soldering the chip, as already suggested, is the only practical solution.

Could be interesting:

https://www.gammon.com.au/forum/?id=12898

28 pin in circuit connector example