Electronic – Cannot enter programming mode ATMega328p

atmega328patmel-studiofusesresetspi

I'm using an ATMega328p Xplained Mini development board. I was able to program it using Atmel Studio 7, being new to AVR programming I accidentally set the RSTDISBL fuse to 0 (has a default value of 1). After trying to reprogram the board using SPI I found out that the RSTDISBL needs to have value 1. Now I cannot enter programming mode using Atmel Studio.

So, is there a way to reset this fuse without having to purchase a different type of programmer, such as JTAG? I have a few spare Arduino boards laying around if those could be of any use. I read through the ATMega328p docs and could not find any info on how to set this fuse.

Best Answer

EDIT: Below descrobed HVSP apparently doesn't work for ATmega328p, check this HVPP as an alternative. The remainder of my answer is still valid.


Check this blog article: Arduino AVR High-Voltage Serial Programmer. You'll probably need to tweak a couple bytes in the code, check the datasheet for the default fuse bytes and change them in the code near the top:

// Desired fuse configuration
#define  HFUSE  0xDF   // Defaults for ATtiny25/45/85
#define  LFUSE  0x62   

Basically what it does is create a High Voltage programmer using an Arduino board and a handful discretes to reset the fuse bytes. Once the fuses are reset to their default values, you can program the chip in the regular way.

The circuit needs a 12V supply to pull !RESET high and enter HV programming mode. Be careful, only this single pin is 12V tolerant.

This little (Linux based) project defaultFuses may be of some help trying to figure out the default fuses. All it does is program the default fuses to the configured controller, but of course you'll first need the HV-programmer to unbrick your controller. It does however show the values which it will attampt to program.