• Blog
  • LDS
    • Canada
    • Japan
    • U.K.
    • U.S.
    • World
    • Politicians
  • Site
    • About
    • Archive
    • Best of Rickety
    • Comments Policy
    • Copyright
    • FAQ
    • Feedback
    • Guests
    • Privacy Policy
    • Technical
    • Why Blog?
  • Sundry
    • Comics
    • HyperCheese Help
    • JFHE
    • Projects
      • Book of Mormon
    • Wishful Thinking

Rickety

Mostly about Utah

  • Family
    • Jill
    • Rick
    • Children
      • Daniel
      • Jake
      • Paul
      • Sarah
      • Steven
    • Children’s Spouses
      • Adelaide
      • Derek
      • Megan
      • Rachel
      • Shelese
    • Grandchildren
      • Aurora
      • Benjamin
      • Bryson
      • Caleb
      • Calvin
      • Cassandra
      • Elizabeth
      • Ezra
      • Helen
      • Jameson
      • Ryan
      • Sadie
  • Finance
    • Bank Rewards Checking
    • Credit Union Rewards Checking
    • Debt
    • Employment
    • Money
    • Rewards Checking Posts
  • Government
    • City
    • Elections
    • Federal
    • Military
    • Paul on Politics
    • Politics
    • States
    • Taxes
  • Recreation
    • Competition
    • Food
    • Fun in Utah
    • Games
    • Music
    • Parade
    • Sports
    • Travel
  • Religion
    • Christmas
    • Family History
    • Jesus Christ
    • LDS
    • Marriage
    • Missionary
    • On Religion
    • Preparedness
    • Scriptures
    • Temple
  • Series
    • 100 Years Ago
    • Christmas Letter
    • Epic Excerpts
    • On Religion
    • Past Pictures
    • Daniel’s Mission
    • Jake’s Mission
    • Paul’s Mission
  • Technology
    • Applications
    • Blogging
    • Communication
    • Computer
    • Energy
    • Environment
    • How To
    • Photography
    • Population
    • Transportation

Arduino AVR High-Voltage Serial Programmer

March 19, 2010 by paul w 115 Comments

My son Paul is the author of this guest post.

This Arduino sketch is useful for rescuing ATtiny microcontrollers rendered useless by incorrect fuse settings. It does this by putting the bricked tiny into high-voltage serial programming mode and writing the fuses to safe values.

Connection Diagram

Diagram

Click to enlarge

The Arduino is connected to the tiny though 1k resistors and a 2N3904 transistor is used to switch 12 volts applied to the tiny’s reset pin. After uploading the sketch the Arduino sends “Enter a character to continue.” repeatedly until communications are established by sending a byte through the serial monitor. The Arduino then programs the fuses.

Serial Monitor log

Enter a character to continue.

Enter a character to continue.

Enter a character to continue.

1

Entering programming Mode

lfuse reads as 62

hfuse reads as 5F

efuse reads as FF

Writing hfuse

Writing lfuse

lfuse reads as 62

hfuse reads as DF

efuse reads as FF

Exiting programming Mode

Download the program: hv_serial_prog.pde

Based on work by Jeff Keyzer.

Let me know if it works for you.

Filed Under: How To Tagged With: ATtiny, Bricked

Comments

  1. Paul says

    February 21, 2016 at 8:22 am

    Works like a charm.

    My AtTiny13 was bricked due to a corrupted Boards.txt file. I fixed it with your sketch.

    My implementation on a breadboard was:
    – 1K resistors for R1-R4
    – 18k for R5
    – BC547B for T1 (most general purpose NPN will do 546,548)
    – A 12V LED power supply

    Thank you for sharing!

    Reply
  2. Rhoderik says

    May 28, 2016 at 1:16 pm

    Thanks so much! I just rescued 4 attiny85’s!!!

    Reply
  3. Takao Shimizu says

    November 4, 2016 at 7:50 pm

    Works fine.
    Thank you.

    Reply
    • Takao Shimizu says

      November 4, 2016 at 7:56 pm

      I pulled up by 10k at IO13 for just in case.

      Thank you for sharing!

      Reply
  4. Cameron says

    September 5, 2017 at 2:43 pm

    Hi All,
    In order to reset the fuses on the ATTINY24 use this pinout.

    //SDI PA6 I Serial Data Input (pin 7)
    //SII PA5 I Serial Instruction Input (pin 8)
    //SDO PA4 O Serial Data Output (pin 9)
    //SCI PB0 I Serial Clock Input (pin 2)
    //must ground pins 11,12,13)

    Reply
  5. Jean-Roch Blais says

    December 3, 2017 at 9:16 pm

    Hello, I’m wondering what the !! in this code snippet does:
    if (bitOrder == LSBFIRST) {
    digitalWrite(dataPin, !!(val & (1 << i)));

    Is it a not not ?
    Thanks and great code !

    Reply
  6. matt says

    March 6, 2019 at 8:02 pm

    thanks, this saved my attiny44. i had to program it in-circuit as it was a soldered down soic-14.

    i ran into issues using the arduino to power the target, though. it just hung at “Entering program mode”.

    the solution was to connect the target attiny44’s power directly up to 3.3v out on the arduino, then it was able to communicate.

    not sure if it was too low current or what.

    btw, on this chip CLOCK/PB3 actually needed to go to pin #2 on the attiny – (PCINT8/XTAL1/CLKI) PB0. i was able to connect the other 6 pins to the corresponding pins on the target’s ISP header.

    Reply
  7. bajji says

    July 4, 2020 at 2:26 pm

    Thanks . Worked for me.

    Reply
  8. Anonymous says

    September 24, 2022 at 11:20 am

    this is super …….. thanks soo much….

    Reply
« Older Comments

Trackbacks

  1. Display Blog says:
    October 19, 2017 at 9:46 pm

    Arduino Usb To Serial Converter

    […] structions to read and write the fuse bits are similar. I would first try commen […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Comments

  • Anonymous on One Hundred Thousand Milpengo
  • Jeremy McMullin on Mesa Easter Pageant – Jesus The Christ
  • Genma Vincent on George W Bush on Religion
  • Anonymous on The Twelve Stones of The Apocalypse
  • Judy Crowe on Ten Artists Paint Old Testament Women
  • Angela on The Twelve Stones of The Apocalypse
  • Angela on The Twelve Stones of The Apocalypse
  • AllHailKingJesus on The Twelve Stones of The Apocalypse
  • Microwave guy on Make a Halloween Costume from a Microwave Oven
  • Anonymous on Arduino AVR High-Voltage Serial Programmer

Who is this Rickety?

Rick at homeI'm Rick Willoughby. I live in Utah, a retired Software Engineer. I'm a Mormon, married with 5 children and 12 grandchildren.

I emigrated from England in my late twenties, bringing with me one small suitcase and a few dollars. I appreciate the opportunities America has given me and the friendliness of the people to new citizens.

I blog about my family as well as politics, religion, finance, technology, and other topics.

Copyright © 2025 · Lifestyle Pro Theme on Genesis Framework · WordPress · Log in