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]

Comments

  1. op says:

    but what if you mess up the fusebits on your fusebit doctor?

  2. mrgoogfan says:

    why would they put in fuse bits if they are so hard to reset?

  3. Paul says:

    Too bad it doesn’t run on an AVR, that could be awesomely ironic ;)

  4. @Paul – I thought the ATMega8 was in the AVR family of microcontrollers…

  5. Miles Hansen says:

    Needs a ZIF socket, then it will truly legit. No one wants to keep inserting DIPs into those little sockets.

  6. Stpq says:

    @mrgoogfan, Paul: I hope you two are joking.

  7. Brennan says:

    @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.

  8. Drone says:

    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.

  9. The Moogle says:

    dont forget the Arduino Saver Shield I made :)
    Very useful for fixing bricked arduino pro’s

    http://wtfmoogle.com/?page_id=694

  10. Paul says:

    @ myself

    I see, I didn’t know that. Forgive me for not reading the wiki :/

  11. Jon says:

    Sounds like we have another feature to add to the bus pirate ;)

  12. saimhe says:

    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 ;)

  13. Ryan says:

    The PIC chips I usually use don’t have this problem… The fuse that locks out low voltage programming can only be set by a high voltage programmer… :P

  14. bogdanfirst says:

    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.

  15. Victor says:

    Not open source code.. only hex and bin files..

  16. Alexander Rossie says:

    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

  17. Angus says:

    @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.

  18. Alchemyguy says:

    @Victor: So? My washing machine is not open source, and it does a great job.

  19. Ryan Leach says:

    this is hardly repairing AVR’s, dodgy title…

    maybe try a title like, AVR Fusebit fixer

  20. Brent says:

    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?

  21. Sepp says:

    I think this is a cool tool for a lot people who plays with µc. Not everyone own an HV programmer in his workshop.

  22. Manekinen says:

    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 :)

  23. Drew Mallager says:

    This is great for those soldering kits from maplins. They are fun to practise soldering and then become a dev board =D

  24. ScottJ says:

    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.

  25. Manekinen says:

    03.06.2010 – UPDATE #2

    http://diy.elektroda.eu/atmega-fusebit-doctor-hvpp/#eng

    Added HVSP support, two adapters, 96 supported chips (53 in DIP sockets, rest are SMD packages)

  26. amishx64 says:

    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.

  27. Manekinen says:

    Hi amishx64, i think that someone who is playing with microcontrollers, will not make that silly mistake, so i did not put there any protection diodes :)

  28. Manekinen says:

    31.07.2010 – #3 UPDATE.

    Firmware 2.04 – 138 chips supported.

    More: http://diy.elektroda.eu/atmega-fusebit-doctor-hvpp/#update3en

  29. ckeays says:

    microcontrollerprogdotcom
    under $30, not worth to build one yourself.

  30. Manekinen says:

    Do you try to advertise this on every site with my project?

    Only 45 supported chips and you tell me this is worth a 30$?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,463 other followers