This all started last year, when I was playing with an ATmega168 microcontroller and did something silly. I programmed the RSTDISBL fuse bit, which effectively makes it impossible to reflash the chip using an ordinary (serial) programmer.
Instead of giving up and throwing out the “dead” chip, I decided to try to revive it using an obscure high voltage parallel programming mode that isn’t supported by most AVR programmers. Armed with my Arduino and the ATmega168 datasheet, I quickly designed and constructed a programmer using parts I already had on my workbench.
A few hours later, I tested my new programmer and it worked! I revived my “dead” AVR by using spare parts and a few lines of Arduino code. That week I published the schematics and Arduino sketch to the site and called it my Arduino-based AVR High Voltage Programmer.
The response was overwhelming. Since I first posted the design, many people have built their own and used it to fix their “dead” AVR microcontrollers by restoring the fuse bits to sane values. I even received several requests for a PCB and/or kit based on the design, which got me thinking…
Today I’m proud to introduce:
The AVR HV Rescue Shield
The AVR HV Rescue Shield is a high voltage parallel mode fuse programmer for Atmel AVR microcontrollers.
It currently supports the ATmega48/88/168/328 series and the ATtiny2313. The Rescue Shield does everything my original AVR High Voltage Programmer does, and a lot more. I think the new features make this a really useful tool for anyone working with AVR microcontrollers.
New features include:
- Custom 2-layer PCB with silkscreen and soldermask. No more hacking and modifying perfboards to fit Arduino’s nonstandard pin spacing!
- Onboard 12V DC-DC boost converter eliminates the need for an external 12V power supply
- Support for two of the most common families of AVR microcontrollers, the ATmega48/88/168 and ATtiny2313
- Support for programming the extended fuse (EFUSE) byte.
- A new interactive mode, where desired fuses can be entered using the Arduino’s serial port.
- Separate Ready and Burn indicators
- Protection resistors on every single data, control, and supply line to the target AVR, meaning that your Arduino and AVR should survive any mishaps during programming, including inserting the AVR backwards or off by 1 pin.
I spent considerable time testing each new feature and documenting the Arduino sketch. I hope that you’ll find that the finished product was worth the wait!
To purchase bare PCBs and kits, head over to the AVR HV Rescue Shield product page.
Make: recently released their 2008 guide to open source hardware – a Christmas list of sorts for hardware geeks.
There are lots of cool kits and projects on the list, including a few I hadn’t seen before, such as the Fusebox.
MAKE: Blog: Open source hardware 2008 – The definitive guide to open source hardware projects in 2008.
Update 01/02/09: A PCB version of this circuit is in the design stages – some preliminary information is here.
Update 03/11/09: Kits based on this design are now for sale!
Update 12/14/10: The original AVR HV Rescue Shield kit has been replaced by the new and improved HV Rescue Shield 2. Visit the HV Rescue Shield 2 product page for information about the new kit!
As I mentioned earlier this week, I recently “lost” an ATmega168 due to flashing the configuration fuses to disable the RESET pin, without realizing that this makes the device impossible to reflash with SPI. This is particularly frustrating because the device is still 100% functional, just completely deaf to ordinary serial programmers. The only way to recover the device is using what Atmel calls “High Voltage Parallel Programming Mode” which very few programmers support, most importantly, not the USBtinyISP I otherwise love.
Fortunately, my trusty Arduino came to the rescue – I created an Arduino-based AVR programmer that uses the high voltage programming mode and can fix pesky fuses like RSTDISBL.
The Arduino has just enough IO to implement the entire HV protocol plus a “go” button. So far I have only implemented setting LFUSE and HFUSE in software, but there is no reason why the code couldn’t be extended to support chip erase and programming the entire flash as well.
The fuse programming process is simple:
- Upload the HVFuse sketch to the Arduino, available for download here: HVFuse.pde
- Install the shield and apply +12VDC to the terminals on the left
- Wait for the red LED to turn on (if it isn’t already)
- Install the ATmega to be repaired
- Push the button
- As soon as the LED turns back on, the AVR is fixed and ready to be put back into service!
Here is an Eagle schematic of the HV Programming shield (click to enlarge):
Update 12/17/08: An observant reader pointed out that there were three errors in the way GND/AGND, AREF and VCC/AVCC were connected on the target AVR in the original schematic. The errors have been fixed and the updated schematic is below. Apologies for any confusion this caused.
- An Arduino NG, Diecimila, or compatible
- A piece of perfboard cut to size
- Header pins for the Arduino interface (note I had to drill some of the holes to get the headers to fit the nonstandard pin spacing for digital lines 8-13.
- An LED which indicates when it is ok to insert/remove the AVR
- A 2N3903 or similar NPN transistor (2N2222, etc.)
- (20) 1k resistors – these protect the Arduino from short circuits in case something goes wrong
- A pushbutton switch – this is the ‘go’ button
- A 28 pin socket for the target AVR
A kit version of this project is available. Visit the HV Rescue Shield 2 product page for more information.