9/24/2025, 5:24:32 PM
DIY High Voltage AVR Programmer

July 19, 2025

Fixing a Fuse-Bricked ATmega328P

Credit goes dmjlambert's HV Rescue Project for helping me build the programmer. This article focuses on my experience debugging the fuse bit and building a programmer.

A few months ago, I was working on a project that required programming an ATmega328P microcontroller over SPI. I accidentally set the wrong fuse bit, which "bricked" the chip, making it impossible to program through normal in-system programming. Fuse bits control low-level behavior like clock sources, brown-out detection, bootloader size, and programming interfaces.

At first, I didn't realize I had bricked it. All I knew was that the chip wouldn't respond, and AVRDUDE kept throwing errors hinting at a non-existent device. What followed was several evenings of debugging and trying increasingly specific solutions before I finally discovered the real culprit.


What Went Wrong

In my case, the culprit was the RSTDISBL fuse bit, which disables the external reset pin. Normally, when you start programming over ISP (In-System Programming), the reset pin is toggled to put the microcontroller into programming mode. But with RSTDISBL set, that pin behaves like a normal GPIO pin, preventing the chip from being reset by an external source.

Here's what AVRDUDE reported when I tried connecting to the chip:

bash
avrdude: AVR device initialized and ready to accept instructions avrdude: device signature = 0x000000 (retrying) avrdude: device signature = 0x000000 (retrying) avrdude: device signature = 0x000000 avrdude main() error: Yikes! Invalid device signature.

At first glance, I assumed it was a clock related issue because the onboard LED would pause abruptly when any communication over SPI was initiated. The datasheet makes it clear that certain fuses . So I provided the chip with external clocks; a crystal oscillator, and a square wave from a signal generator.

Square Wave Clock Generated from STM32F4

Square Wave Clock Generated from STM32F4

I then thought it could've been a hardware failure. I probed continuity on every pin but still no luck.

Finally, after rereading the datasheet and digging through forum posts, I stumbled upon the possibility that I had set the RSTDISBL fuse. That one bit explained everything: ISP could never work again without some form of High Voltage Parallel Programming (HVPP).

High Voltage Parallel Programming

Older AVR chips microcontrollers have built-in support for high voltage programming interface. Unlike ISP, HVPP doesn't rely on the external reset pin. Instead, it forces the chip into programming mode using a dedicated 12V pulse on RESET with a special parallel protocol.

The catch? You need hardware support for HVPP. Commercial programmers that support it (like the Atmel STK500) aren't cheap, and I didn't have one lying around. However, because this is a common mistake, the AVR community has documented novel and simple ways to build one with off-the-shelf components.

That's when I came across dmjlambert's HV-Rescue project. It's a simple circuit that uses a 12V power supply to power the RESET pin, and a 5V power supply to power the programmer.

Building the Programmer

I won't rehash the full build instructions here since the this project is already well documented. The short version is that I needed two ATmega328P chips; one to act as the programmer and one to act as the target, a 12V power supply, and some electronic components. 12V went to the target's RESET pin, and parallel protocol signals connected between the two chips.

It worked like a charm on my first attempt. I was able to see the culprit fuse bit and fix it.

Culprit Fuse Bit RSTDISBL

Culprit Fuse Bit RSTDISBL

The AVR documentation states that the most significant bit is the RSTDISBL fuse bit.

Note: fuse bits are read as logical zero "0", if they are set.

Lessons Learned

  • Fuse bits are a powerful tool for debugging and configuring a microcontroller. Don't be afraid to experiment with them but always double-check what you're setting
  • Don't set the RSTDISBL fuse bit unless you really need an extra data pin or know what you're doing
  • Debugging dead ends isn't a waste of time. Testing clock sources and continuity didn't solve the problem, but they gave me confidence in the final diagnosis and intuition to identify this problem in the future