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
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.
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:
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.
- 2kB:
- 4kB:
- 8kB:
- 16kB:
- 32kB:
- 64kB:
- 128kB:
- 256kB:
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:
- Added support for HVPP chips: AT90s8515, AT90s8535, AT90s1200, AT90s4433, AT90s4414, AT90s4434, AT90s2333;
- Added support for HVSP adapter and HVSP chips: (8pin) Attiny11, Attiny12, Attiny13, Attiny15, Attiny25, Attiny45, Attiny85, Attiny22, AT90s2323, AT90s2343 (and 14pin) Attiny24, Attiny44, Attiny84.
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…
- Not all of chips names are send over rs232, but most common. This does not affect fixing process in any way.
- 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.
diy.elektroda.eu