1
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Great answer, I'll test it out later today and report back with the results \$\endgroup\$ – David Paquette Jan 25 '16 at 20:39
  • \$\begingroup\$ Followed the linked article and found the correct HFUSE and LFUSE bits from the chip's doc. After building the circuit and trying to figure out why it wasn't working I started to read through the comments. The ATMega328p uses a different high-voltage programming protocol than the one in the article. I found this tutorial: AVR High-Voltage Programmer. But this is too much for me to build by hand, I'll just purchase a new board. \$\endgroup\$ – David Paquette Jan 26 '16 at 2:01
  • \$\begingroup\$ The website is down, can't check the comments right now. Do you remember key words I can look for once it returns online? @DavidPaquette \$\endgroup\$ – jippie Jan 26 '16 at 6:01
  • \$\begingroup\$ I did CTRL-F for "328p" and a few comments showed up, I was just able to access the site. \$\endgroup\$ – David Paquette Jan 26 '16 at 14:17
-1
\$\begingroup\$

You can use another Arduino board as a programmer for your broken Arduino ! This can for example be used to program an Atmega328 without a bootloader.

It is all explained in this video.

\$\endgroup\$
  • \$\begingroup\$ Thanks for the answer! Could this method be used to program the fuse bits as well? \$\endgroup\$ – David Paquette Jan 25 '16 at 18:55
  • \$\begingroup\$ @DavidPaquette You can most certainly program fuse bits, it's possible, however, to do so you'll need to make a high-voltage tweak, to trigger the reset, now that it's disabled. \$\endgroup\$ – Asmyldof Jan 25 '16 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.