Inspired by the pioneering work of Jeff Keyzer, the AVR-Doc is a handy way to resurrect a dead 28-pin AVR (ATmega 328/168/88/8) microcontroller that has been "bricked" by setting the wrong fuse bits! To fix the ATmega fuses you'll need a 12V-13V power source (a 3S Li-Po battery pack is perfect!), and an Arduino board.
It is also a stand-alone USBasp ATmega programmer, allowing you to burn Arduino bootloaders, or any HEX file directly without an Arduino board, or any other external connections/hardware, other than a mini-USB cable. A standard 6-pin AVR ISP port is also available for off-board programming applications. USBasp is now directly supported by Arduino 1.0 RC2 and above, as does AVRDUDE, so it's incredibly easy!
The target 28-pin ATmega socket has Arduino pin D13 (PB5/SCK) connected to an LED, so you can verify if your code worked, even while the chip is still in the programming socket! There is also also a PCB header for a standard through-hole 3-pin oscillator, allowing code/fuses to be tested that require an external oscillator/crystal.
The USBasp programmer is now directly supported by Arduino 1.0, for programming both bootloaders, and sketches, onto any supported AVR ATmega microcontroller. No changes to the Arduino preferences files are required, simply choose "Upload using Programmer" in the file menu.
For Windows XP/7 drivers and more background information, the USBasp home page is here: http://www.fischl.de/usbasp/ Windows drivers are on the same site at: http://www.fischl.de/usbasp/usbasp-windriver.2011-05-28.zip
As with most of our boards, we don't install or include headers or plugs, since the choice will vary greatly depending on the application and personal preferences. They are available (at a very low cost!) in the "Wires, Headers & Plugs" category. The 40-pin standard header would be the most common choice to set it up as an Arduino shield.
Here's the Arduino sketch for fixing AVR 88/168/328 fuses: AVR_Doc_fusefix.pde
Quick summary of operations, from fix to program:
- Load the sketch into your Arduino and then unplug it.
- On the AVR-Doc, move the two switches to "ARD and FIX"
- Plug the AVR chip into the socket. Watch the orientation, the indent goes left!
- Attach the shield, the 12V power source, and power up the Arduino.
- After a few seconds the red "FIX" light should turn on.
- Push the "FIX" button and when the red light comes back on, you're done!
- Plug the AVR chip into the socket, or connect via the 6-pin ISP connector.
- On the AVR-Doc, move the two switches to "PROG and PROG"
- Plug the AVR-Doc into the USB ON ITS OWN, NOT AS A SHEILD! (If shield headers are installed, be careful not to short shield pins with anything metal on the workspace.)
- Load drivers, if needed. (see links above)
- Use a program like AVR Burn-O-Mat, or Arduino to program the AVR.
- If using Arduino, be sure to choose "USBasp" in the "Programmer" sub-menu.