Attiny fusebit doctor (HVSP) – napraw fuski
Pomyliłeś się przy ustawianiu, lub celowo wyłączyłeś pin resetu (RSTDISBL) czy możliwość programowania przez ISP (SPIEN)? Nie ma sensu kupować lub robić niewygodnego i skomplikowanego programatora HV, tylko po to aby odblokować kilka procków. To urządzenie wyleczy problemy z fusebitami w mikrokontrolerach z szeregowym HV – szybko i sprawnie ustawi je do wartości fabrycznych. Obsługuje wszystkie uC AVR z interfejsem szeregowym HV, czyli 8-nóżkowe: Attiny11, Attiny12, Attiny13, Attiny15, Attiny25, Attiny45, Attiny85, oraz 14-nóżkowe: Attiny24, Attiny44, Attiny84.
Całość bardzo prosta i tania w wykonaniu – sercem układu jest Attiny2313, do tego kilka rezystorów, tranzystorów, i stabilizator 5V. Zasilanie układu – stabilizowane 12V. Naprawa rozpoczyna się zaraz po naciśnięciu przycisku START. Przycisk jest ponownie aktywny po 250ms i jego przyciśnięcie spowoduje zresetowanie układu i wykonanie operacji jeszcze raz.
Oznaczenia diod:
świeci zielona – fusebity naprawione i zweryfikowane, układ naprawiony. Jeśli jest ustawione zabezpieczenie lockbit, to tylko sprawdza czy fuski odpowiadają fabrycznym, i jeśli tak to także zapali tę diodę.
świeci czerwona – problem z odczytaniem sygnatury, brak układu, lub brak sygnatury w bazie.
migająca zielona – sygnatura odczytana, fusebity się nie zgadzają z fabrycznymi, ale ustawione są lockbity i trzeba zezwolić na wymazanie pamięci aby je naprawić (czytaj dalej).
migająca czerwona – sygnatura odczytana, lockbity wyłączone, ale nie można z jakichś powodów zapisać nowych fusebitów, nie przechodzą weryfikacji po 10 próbach zapisu.
Urządzenie wykorzystuje wysokonapięciowe programowanie szeregowe (high-voltage serial programming, HVSP). Najpierw pacjent jest wprowadzany w tryb programowania wysokonapięciowego, następnie odczytywana jest sygnatura i sprawdzana czy dany procek obsługujemy. Następnie cała pamięć jest wymazywana jeśli użytkownik zezwolił na to zworką. Następnie sprawdzane są lockbity, i jeśli nie są aktywne pacjent otrzymuje nowe fusebity zgodne ze swoją specyfikacją. Po tym zabiegu fusebity są weryfikowane i jeśli przejdą próbę – to już koniec. Jeśli nie, doktor powtarza zapis i weryfikację 10 razy, i jeśli nadal będą błędne – doktor poddaje się.
Dodatkowo na płytce znajdują się dwie zworki:
chip erase – zezwala na całkowite wymazanie pamięci flash. W przypadku kiedy są włączone lockbity (fusebity zabezpieczające) nie mamy możliwości zmiany fusebitów, a jedynym sposobem na wyłączenie lockbitów jest wymazanie całej pamięci. Założenie zworki skasuje pamięć.
unknown signature – zdarza się dość rzadko, ale jednak, że uC ma uszkodzoną sygnaturę. Sygnatura, bajty kalibracyjne, i inne dane nie są na stałe zapisane w strukturze układu i mogą w pewnych przypadkach ulec usunięciu – np. na wskutek przepięć zasilania, np. przy programowaniu czy włączaniu/wyłączaniu zasilania. Sygnatura w takim przypadku będzie najczęściej odczytywana jako FF FF FF, ale układ nadal normalnie działa, daje się zapisywać i odczytywać z pominięciem sprawdzania sygnatury. W przypadku gdy odczytana sygnatura nie będzie pasowała do tych zapisanych w pamięci (czyli między innymi FF FF FF czy 00 00 00), doktor spróbuje wgrać uniwersalny zestaw fusebitów, który co prawda namiesza w ustawieniach taktowania itp, ale włączy z powrotem reset (wyłączy RSTDISBL) i włączy możliwość programowania przez SPI (włączy SPIEN) – mikroprocesor taki będzie zdatny do dalszej naprawy poprzez ISP lub inny “zwykły” programator. UWAGA nie stosować w przypadku Attiny11 i Attiny15.
Fusebity: wewnęrzny zegar 4MHz nie dzielony przez 8, dobrze też będzie włączyć “fast rising power” aby do minimum skrócić czas przez który piny będą w stanie nieustalonym.
UWAGA: PROGRAM W WERSJI BETA. Urządzenia nie miałem jak przetestować na wszystkich wymienionych uC, jeśli coś jest nie tak to proszę o info, niezwłocznie poprawię.
Już niebawem: AVR Atmega fusebit doctor (HVPP) czyli doktor dla procków z interfejsem równoległym wysokonapięciowym.
UPDATE 3 maj 2010 -> Atmega fusebit doctor.
POBIERZ – pliki projektu eagle 5.4.0, schemat i płytka w PDF i PNG, wsad HEX i BIN.
.
.
UPDATE 9 maj 2010 -> Dodano obsługę procesorów:
8pin: Attiny22, AT90s2323, AT90s2343
Poprawiono(?) błąd przy tiny15 i tiny11. W załączniku również źródło.
Nie testowałem tych procków z prostego powodu – nie posiadam ich. Więc program nadal w wersji BETA – przestanie nią być jeśli ktoś potwierdzi działanie.
POBIERZ – Wsad V2 HEX oraz BIN, także kod źródłowy BAS.
.
.
Did you make a mistake while programming fusebits, or purposely disabled reset pin (RSTDISBL) or ISP programming (SPIEN)? No need to buy or make inconvenient HV programmer only for unlock couple of Tiny AVR’s. This Attiny fusebit HV doctor will cure your tiny microcontrollers, by restoring all fusebits to factory settings – nice and easy. Supports all of the serial high voltage interface AVRs, that is 8-pins: Attiny11, Attiny12, Attiny13, Attiny15, Attiny25, Attiny45, Attiny85, and 14-pins: Attiny24, Attiny44, Attiny84. This is very simple and cheap to make, the brain of device is an Attiny2313 uC, couple of resistors and transistors, and a 5V stabilizer. You need 12V stabilized supply for this. Repair begins after the button START is pressed. Button is active again after 250ms, so pressing it will reset device and start a new repair process.
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, can’t pass verification after 10 attempts.
Device uses the High-Voltage Serial Programming (HVSP) to repair fusebits. First of all patient is switched to HV memory programming, then we read signature and check if it’s supported. Then the chip erase is performed if user allows it. Next the lockbits are read, if they not set, patient receives new fusebits, proper for readed model. After that, fusebits are verified, and if they pass the test – this is end of work. If not, doctor will repeat write-verify cycle 10 times, and give up when no success.
You can find two jumpers on board:
chip erase – permit to erase whole flash memory. If lockbits are enabled, there is no possibility to set new fusebits. And there is only one way to disable lockbits – by erasing whole flash. Jumper close – permission to erase flash
unknown signature – it happens very rare, but it happens, that uC has erased signature. Signature, calibration bytes, and other data are not permanently stored in uC structure and they can be accidentally erased due to power supply spikes during programming or power cycling. Generally signature will be read as FF FF FF, but chip will work good, flash can be readed and written. If signature will not match to one from doctor database (FF FF FF or 00 00 00 too), closing this jumper will write a universal fusebits pack which will mess oscillator options and such, but will repair functionality of reset (disable RSTDISBL) and ISP programming (enable SPIEN). Microcontroller will be possible to further repair on SPI normal programmer. DO NOT use this option with Attiny11 or Attiny15.
Fusebits: internal 4MHz clock not divided by 8. Will be good to select the “fast rising power” too.
UPDATE 3 may 2010 – If you are searching for atmega family AVR’s fusebits fix device, then check my next project, the Atmega fusebit doctor.
ATTENTION: FIRMWARE IN BETA VERSION. I was not able to test all of the mentioned uC’s, so if something is going bad, please contact me and i immediately make corrections in code.
DOWNLOAD – eagle 5.4.0 project files, PDF & PNG schematic and PCB’s, HEX & BIN firmware.
.
.
UPDATE 9 may 2010 -> Added support for chips:
8pin: Attiny22, AT90s2323, AT90s2343
Fixed(?) bug with tiny15 and tiny11. Added source code.
I did not test these uC’s – i don’t have it. Program still in BETA version – someone must confirm if it works good.
DOWNLOAD – Firmware V2 HEX and BIN, also source code BAS.
.
.
video file is located on a free server, so give it a few seconds to buffer

1 lutego 2010 | | Dodał manekinen 








W kategoriach:
Tagi:
28 komentarzy
Witam,
świetny pomysł – niejednokrotnie przez przypadek (przecież nie celowo:) ) blokowałem fus’y w megach ,, przez kilka lat w szufladzie zgromadziło się ich sporo.. Szybciej było wydać 4zł na nowy klocek niż bawić się w odblokowywanie , lecz – czas na akcję anty-blokowania ;) – z niecierpliwością czekam na wersję pod Megi’…
Tak się składa że często się bawię tymi malutkimi prockami, no i wykonałem ten układ twój.
I jestem mile zaskoczony, sprawdziłem na attiny13, attiny25 i attiny85 i w ułamku sekundy zapalał zieloną diodkę.
Nie odważyłem się specjalnie psuć fusebitów żeby sprawdzić działanie, ale nie długo robię układ z wykorzystaniem właśnie pinu resetu jako zwykłego pinu więc zobaczymy jak będzie sobie dawał radę :)
I tez zapytam kiedy będzie wersja pod atmegi, chyba jak każdy mam kilka zablokowanych z czasów zaczynania zabawy z mikrokontrolerami
Pozdrawiam serdecznie
Hı,
I programmed an attiny2313 and atmega16 by wrong fuse bits(excuse me my english language is poor).
Now ponyprog don’t see these processors. there fore I want to repair this ICs.
Can I use this circuit to repair for attiny2313 and atmega16?
I read from other forums,but I am not sure this.
thank you…
Hi!
No, you can’t. This is for “high-voltage SERIAL programming” uC, and yours uC are “high-voltage PARALLEL programming”. This device will only repair those avr tiny uC, not mega. But i am working now on repair tool for mega uC (support also tiny2313), so stay tuned :)
thank you very much.
I will be waiting for your new fusebit doctor with impatience.
(you can delete this comment,only I wrote for thanks)
Na Attiny 15 nie działa. Na Attiny25 działa .Tyle mi się udało sprawdzić .
Pozdrawiam
To kiedy ten fusownik do Atmeg będzie?
Niestety kompletnie nie mam czasu żeby posiedzieć nad kodem, doktor dla rodziny mega będzie ale nie mam pojęcia kiedy… postaram się w któryś weekend wykonać płytkę i skrobnąć kawałek kodu który przynajmniej będzie atmega8 odblokowywał, ot taka wersja bardzo-beta.
Piotr dzięki za info z attiny15, niestety takiego procka nie posiadam aby się pobawić nad kodem ale jak już znajdę błąd to podeślę ci na email nowy kod do przetestowania (o ile podałeś prawdziwy ;) )
Very nice project! I have two questions:
1) Can you make version with other AVR as the doctor like the more used mega8/48? Or just release the source :)
2) Of the tiny family the tiny26/261/461/861 aren’t mentioned so I guess they are HVPP and not HVSP? I saw you’re working on mega repair tool, does it mean it can repair all that uses HVPP (and is implemented)?
I suggest you put onboard some 12V generator, it could be done with dedicated chip like MAX662A or just with PWM on AVR, that would be cool. You can check the AVRminiProg which does it http://www.simonqian.com/en/AVRminiProg/
Good luck with the next version!
I looked at the schematic again. Well the 12V generator was meant for powering by 5V source instead of 12V input, then it’s obviously not needed (but needs to be well regulated) :)
1. Hi, i can send you source code but not now, i have it on my computer, i do this maybe tomorrow, so you can mod this to use with mega8 with no problem.
2. yep, tiny26 (same as tiny2313) is HVPP, take a look in datasheet :) Yes im working on mega doctor, but don’t have much time for my toys :( PCB is projected with three slots, for mega16/32/644 etc, for mega8/88/168 etc, and for tiny2313 etc. There is also goldpin connector with all the signals so we can easy make adapters for other uC’s, in mega8 which will be the doctor, is plenty of space to put data for all the hvpp uC’s. In this weekend i make pcb and write code to cure at least mega16 mega8 and tiny2313. Take a look at my site sometimes, i will publicate this as soon as it starts to work :)
3. I see no need to put there 12V generator, it will only complicate pcb and raise the costs. I guess there is no problem with 12V suplly :) But thanks for advice, maybe i make simple generator with two transistors. I try to do some testing if i find time. And do not have free pin so it cant be done on host atmega, all pins from mega8 are used.
PCB for mega doctor, it’s still in project… :)
T.Cím!
Megcsináltam attiny fusebit doctort,de a start gomb megnyomása után a piros led kigyullad.
Betettem egy jó attiny45-t,annál is ugyan az a helyzett.
Ha tud segítsen(help).
Üdv:Ochmánszky Attila
T. Cim!
Megcsináltam ATtiny fusebit doctort de Gombe ÉS elkezd megnyomása utan vezetett piros kigyullad.
Jó attiny45 Betettem EGY-t, AZ ugyan annál a helyzett.
Ha Tud segítsen (Segítség).
Üdv: Attila Ochmánszky
a fuse biteket jól állítottad be?
Hi Attila. I can help, but please write in english or polish. I google-translated your comment, and if i understand correctly, you get red led all the time. Check if you used correct transistors (if E-B-C are not replaced). Check after pressing START, if you get +5V on supply pin and +12V on reset pin of target chip. 12V stabilized supply is very important, this is for correct H-V programming initialization.
Also check connection from R10 (330ohm) to T2 (BC557) – in PCB files there was a small bug, no connection between these elements. Attachment was updated so please download again and check if you have good PCB :)
Hi
Greetings from Croatia.
Thank you for sharing this wonderful project. No doubt it will help a lot of people. I see you made HVPP too! I’m looking foward to see that project completed. Excelent site, with many usefull projects. You should put the link for donations! Keep up the good work!
Hi!
I have very interesting situation, not described on whole internet :)
After half of year of using mega328p, I bought my first attiny2313 and programmed it couple of times while it working in default speed – 1 MHz. Then I add crystal and capacitors and change fuse bits. Then I program changed blinking example. All is ok. But somehow my attiny2313 looses calibration code and signature code. I can still program and change fuse bits while using -F switch for avrdude, but I cannot get back signature code and calibration code. If I use it with external crystal 16MHz, then timings are ok. But without calibration code and with internal calibrated (now – uncalibrated) oscillator it runs almost in ~1,7 MHz. I calculate/guess the value for OSCCAL register and add row to blinking example at the very start – OSCCAL = 0×60. So now this attiny2313 is running at 1 MHz – I checked with chronometer :) Have you any suggestion? Can it be reverted to initial state as it come from shop – with calibration code?
Hi
This happens very rare but it happens, Atmel does not say anything about this. It can not be fixed, the signature bytes can not be (theoretically) erased or changed. I got on my desk two chips with erased signature – Tiny13 and Mega8 – both are FF FF FF and i must use with -F option while programming, but i use internal 8MHz clock in the M8 and it work very well – i did not check the calibration bytes.
Check this thread on avrfreaks forum:
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=72241
But you will not learn anything new. I did not found any other info about signature erasing..
Can I change attiny2313 uC with AT90s2313?
You can try, i do not use any timers, interrupts, or hardware in the code – so it should work :)
Congratulations
This is an issue ‘too controversial’ … There is a lot of ‘chatter’ on the web and you did a decent project.
Again … Congratulations
Eduardo – Brasil
===================
Gratulacje
Jest to kwestia ‘zbyt kontrowersyjny’ … Tam jest dużo gadać w internecie i zrobił porządny projekt.
Znowu … Gratulacje
Eduardo
——————————————————————-