Magically Repair AVR Chips

If you’ve ever spent time working with AVR microcontrollers you’ve probably set the fuse bits incorrectly at least once. The ATmega fusebit doctor will automatically repair the fuse bits and get you back in business until your next mishap. The ATmega8 that powers the device has the chip signatures for the ATmega family stored inside so it will automatically detect which chip you’re trying to ‘unbrick’. From there it looks up the correct fuse bits and resurrects the sick microcontroller. This is useful in recovering a chip that has serial programming disabled, used the reset pin as I/O, or just enabled an external clock without the necessary hardware to deliver on that feature.

This magic is taken care of by using High Voltage Parallel Programming. We’ve seen HVPP used in the Arduino rescue shield and it is a valuable feature of the AVR Dragon, our favorite AVR programmer, as well as others. Still, you can hardly beat the ease of plugging a dead chip into this board and pressing one button. Oh, did you brick a member of the ATtiny family? There’s a rescue board for those too.

[Thanks Stewe]

30 thoughts on “Magically Repair AVR Chips

  1. @Miles Hansen
    I agree, and the DIP socket he uses for the large chip is especially bad – you have to have the pins perfectly aligned on the micro or you’ll bend some leads trying to get that in and out. ZIF is the way to go.

  2. Arggh… Reinvention of the wheel. Just plug your micro into the AVR Dragon ($49) and set the fuse bits to default with AVR Studio (Free). The AVR Dragon is a full-featured programmer/debugger with HVSP, ISP, and JTAG. No I don’t work for Atmel.

  3. When I worked with P89C52Rx2 (basically an 8051), it was a lot easier to set up the Chip Erase command: all it takes is a weak 12V source, a few constants on pins, and a 500 ms (tolerances rather tight) pulse. The 555 was a saver as always. Perhaps a LPT-based version would have been ready in less time.

    It is worth noting that I never had (or even used) a commercial programmer except a Vantis/Lattice JTAG cable. ISP is a popular thing nowadays, so unbrickers like this one can significantly improve economy. However all is well until you run into necessity to use another microcontroller in the unbricking setup. The solution looks… not elegant :) Of course when most of my playground AVRs will need a helping hand, I’ll still go with one of these projects. It’s nice that there is so much of them.

    @op: a few blank AVRs and triple-checking things can fix that, too ;)

  4. This project is a must for everyone who has used AVRs. With earlier versions of programming software it was really easy to disable the serial programming and end up with a useless micro(unless you had a really expensive programmer). Although it happened to me with just a few devices, I know people who disabled tens of devices. And it comes in handy when you break one and don’t have a replacement to move on with the project.
    Those of you thinking that it needs ZIFs and such things, understand that it has very occasional use, it is not a programmer, so simplicity is the key here. And unlocking requires parallel programming, let me see you arrange all those pins so a ZIF could be used.

  5. Using a non-zif socket risks breaking your AVR. But not using it leaves you with a definately broken AVR =]

    Though I hope in the future everything is ZIF

  6. @Drone:

    If you think it’s stupid or pointless to design or implement something yourself instead of spending $50 on it, you probably don’t belong on this website.

  7. Angus, you need to read on to Drone’s second sentence.

    I don’t see this single-function tool as a must for the AVR hacker. A cheap AVR programmer/debugger will perform the same function and do substantially more, so it’s a much bigger step up at a nominal cost.

    I’m not really sure where this “fusebit doctor” would be at its sweet spot for usefulness. Maybe if you had a bunch of preprogrammed AVRs to recycle? Or if you use low-voltage ISP in production and have occasional emergencies where a bunch of units got programmed with the wrong hex file before anybody realized they were failing tests, and you don’t want to train technicians to use AVR studio? Or maybe in an educational environment where you just don’t want to go through the exercise of introducing anything more complex than fix-it-with-this-thing-with-a-button to people who are getting started with the Arduino?

  8. Hi, i check hackaday rss and see that somebody submitted my doctor :)

    Drone – so spend 49$, i prefer to buy mega8 for 1$ and make it as DIY ;) Also, you can take this everywhere (eg forest ;)), it do not need PC to work ;)

    Victor – yep, it is not a open source, i do not plan to publish sources, sorry. But if you have some questions i will be glad to help :)

    Ryan – THEORETICALLY it’s impossible to reset the SPIEN fusebit in SPI(ISP) programmer – but in practice you can do this after few attempts. Here is the nonsense: SPIEN not, but RSTDISBL fusebit is accesible trough low-voltage, you can write your code, and disable reset. Both make chip deaf for ISP. I think RSTDISBL should not be accessible by ISP too… I don’t know how it is in PIC with clock-select fuses, but here you can set wrong clock source (eg external RC or generator) and without it uC will not work and will not programm.

    Brent – as you say, this circuit is rather for users who plays with AVR occasionally and have couple of blocked chips – it’s cheaper to make this circuit and recover them, than buy new chips.

    To everybody who complains about DIP sockets – Why not ZIF? For now device supports 76 AVR Atmega and Attiny chips, look at datasheets and see how the pinouts differs. To support all pinouts, there should be 9 or 10 slots – now calculate how much you spend on 10 x ZIF slot – this is project must be cheap – instead of spending that money its better to buy real HV programmer :) So i used DIP.

    Always you can make adapter with 1 ZIF slot, and wire it up for the right AVR that you want to cure – it’s not that stupid – there will be no need to make several adapters for different chips…

    OR use the breadboard, wire it up (from 20pin adapter connector) for single chip fix. HVPP pinout is described in any AVR datasheet at “memory programming” -> “parallel programming” – its very simple to connect by names on PCB. BUT if someone is too lazy to check HVPP pinout in datasheet, go and buy new uC.

    For soft updates check my site, i plan to add HVSP adapter to support those tiny 8pin chips too – so you get 2in1 doctor :)

    Also i will be adding adapters for other mentioned uC’s, also i add description which chips fit in which slots.

    If someone make adapter for other chip, i will be glad to publish it on site :)

    Regards :)

  9. I once set the fuse bits to a very slow clock speed which made it not useable by regular programmers.

    However, I was able to “resurrect” my AVR using avrdude with -i and -F flags to force programming with very slow speed, and to only program the fuse bits again with sane values.

  10. I looked at the schematic and disliked the fact that there was no voltage polarity protection, so I added in two diodes. Unless I overlooked something and protection is there, I’d recommend the change for future hardware versions and for others to implement themselves. Other than that, it looks great! Thanks.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.