AVR Atmega Fusebit Doctor (HVPP)

Atmel Atmega8 Atmega16 Atmega32 Atmega64 Attiny2313

Paweł Kisielewski

The project is intended for noncommercial usage only

Atmega fusebit doctor, as name says it, device for repairing dead Atmega family AVRs by writing wrong fusebits. Most common mistakes or problems are a wrong clock source (CKSEL fusebits), disabled SPI programming (SPIEN fuse) or disabled reset pin (RSTDISBL fuse). This simple and cheap circuit will fix you uC in a fraction of a second.

If in first case we can help ourself with clock generator, then in 2nd and 3rd cases bring uC back to life is impossible with standard serial programmer. Most of people do not decide to build parallel programmer because its inconvenient and its cheaper and faster to buy new uC.

This circuit uses the parallel high-voltage programming method. Atmega8 (doctor) has saved in it’s memory signatures of most common AVR Atmega uC’s, just put your dead mega in socket, press the START button, and enjoy your good-as-new processor. There are three slots on board, for most common AVR’s, pins compatible with: Atmega8, Atmega16, Attiny2313. There is also an extra goldpin connector with all signals so you can attach your own adapters for other types of processors, in trough-hole or surface-mounted, you can use the breadboard for this – just connect signals to correct pins. How? Check your AVR datasheet, go to “memory programming” and then “parallel programming” – check the signal names, all signals are described under the DIP40 slot. In doctor memory there is a lot of free space so project may be developed all the time. One sided PCB with 55mm × 92mm dimensions. On top side you need to solder several jumpers, or, make this PCB as double sided – choose yourself. Power: stabilized 12V. Resistors from R7 to R23 may be in 100 Ohm to 10K, but i suggest from 470 Ohm to 1K.

Schematic diagram

Atmega fusebit doctor - Schematic diagram
Click to enlarge

You can find extra RS232 output, connecting to this (at 38000 bps) we will receive all information about fixing process – see exemplary printscreen in gallery. Of course terminal is not needed, all we want to know we get from leds.

AVR Terminal emulator

Attention! While mounting the DIP40 slot, you must to remove it pins from 29 to 37. These pins must not have electrical contact with inserted uC pins. Take a look at this pic, these you must remove from slot:

AVR Atmega Fusebit Doctor (HVPP)

Leds explanation:

  • green on – patient successfully cured, fusebits repaired. If lockbits are enabled, just verify fusebits with factory ones – and if they ok – light up green.
  • red on – signature problem, can’t read, no device in socket, or no such signature in database.
  • green flashing – signature ok, fusebits are wrong. Lockbits enabled, chip erase permission required (read below).
  • red flashing – signature ok, no lockbits, but for some reason can’t write new fusebits.

The ALLOW ERASE jumper allows doctor to erase whole flash and eeprom memory, if it is open, doctor will newer erase memory but may not cure device if lockbits are enabled, so you choose. After insert dead uC and press the START button, doctor will initiate the parallel programming mode. If our patient will not respond with high state at RDY/BSY line, doctor will use other way to initiate programming mode even if the XTAL pins are switched to external resonator. After that doctor will erase whole memory if user allows that. Then, read device signature and check if it supports it. Next are lockbits checked, and if they not blocking device, doctor sets all fusebits to fabric, having regard to whether there are extended fusebits or not. After that fusebits are verified, and proper leds are flashed. Also, all the info are send trough usart.

Code was written based on high-voltage parallel programming section of datasheet of suitable AVRs.

Code for this point supports only Atmega16, Atmega32, and Atmega8 – these was tested. Support for other uC (within Attiny2313) i will ad as soon as i find some time to do that :)

If you are searching for attiny family AVR’s fusebits fix device, then check my previous project, the Attiny fusebit doctor.

Fusebits: Internal 8 MHz clock, and enabled EESAVE bit.

If you get green led, you can be 100% sure that fusebits are restored correctly. If processor still do not respond to standard ISP programmer, that means it have hardware SPI damaged or it is damaged in other way. If you get the red led, the only thing you can do is check what doctor sends over the rs232 – then i can help.

Firmware 2.01 BETA – support for 76 uC’s, Tested ones are lightened green. User feedback is priceless in this project, so if you successfully fixed some chip, or not, please tell me.

For a device to restore the configuration of the fuse-bits of the MCU ATtiny family, go to the project: ATtiny fusebit doctor (HVSP).

Eagle 5.4.0 project files, PDF & PNG schematic and PCB’s version 2.0d, HEX & BIN firmware version 2.01 BETA - download

Update#2 03.06.2010

Hardware update, added two adapters:

  • “#1 adapter” as HVPP extension, for 20pin Attiny26 compatible and 40pin Atmega8515 compatible processors.
  • “HVSP adapter” for 8pin and 14pin HVSP processors.

Firmware update, V2.03:

Device will automatically detect the HVSP adapter and start in the HVSP mode (info on rs232 output).

Added all sockets compatibility list with images… “B” means that this is the adapter #1 socket, and “C” – HVSP adapter socket.

Total supported chips: 96.
Total DIL socket compatible: 53

As this is now 2in1 (HVPP and HVSP) 8kB of Atmega8 memory was too short to fit all the goods inside…

  1. Not all of chips names are send over rs232, but most common. This does not affect fixing process in any way.
  2. Some of text for rs232 are holded in the eeprom memory. Even if you do not need the rs232 output, you MUST write the EEP.BIN to eeprom. This is a BIN (RAW) file, NOT hex.

Download – eagle 5.4.0 project files, PDF & PNG schematic and PCB’s for both adapters, HEX, BIN and EEP.BIN firmware version 2.03.


You may have to register before you can post comments and get full access to forum.
User Name
Fragments of discussion:Full version of discussion »
  • This is new firmware version 2.06: [I]"Fixed Atmega324P signature recognition Added proper timings for Attiny15 on PB.3 Fixed data bug in hvsp „chip erase” command Added proper additional data for Attiny15 „chip erase” command"[/I] And Fuse-bits begining from version 2.04: H:0xE1 L:0xD1 (internal 1 MHz, EESAVE)
  • Firmware version 2.07 and PCB with added pulldown resistor for +5V line [I]"After adding a 100ohm resistor, circuit is more stable, this fixes a problem when some of chips worked in non-HV mode and we can’t fix the RSTDISBL fusebit."[/I]
  • I have a question regarding DOC chip programming. Should I set fuses for DOC chip or just program the Flash memory ?
  • I have great problems with the functionality of a doctor. Programmed I eep file from version 2.03 and update hex file from 11th Fuses I also set the project as the author writes, but sometimes when you press the button flashes green and then the red LED lights up again. Inserting any circuit heal me after pressing the red LED goes out and nothing more is done. after approximately 1 minute the doctor does not cure anything but warm. Please help. already I'm really unhappy. Thank you for your willingness and advice.
  • Hi, I seem to not be able to download the update - I get a 1 pixel gif image only :-( Any help appreciated 73 Nick M0HGU
  • Hi. Firmware version 2.06: [I]"Fixed Atmega324P signature recognition Added proper timings for Attiny15 on PB.3 Fixed data bug in hvsp „chip erase” command Added proper additional data for Attiny15 „chip erase” command" [/I] And Fuse-bits begining from version 2.04: H:0xE1 L:0xD1 (internal 1 MHz, EESAVE) [url]https://drive.google.com/open?id=1ljLvJVoSAES2qAwwxQ4zYuwBDUJSbJf_[/url]
  • Hello, i am a newbie by programming atmega. :confused: I have build this project on a breadboard, but I only get confused signs by the terminal in Bascom Terminal. So my question: what are the complete correct parameters to switch?
Full version of discussion »