Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:15 08 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Doctor for bricked AVRs

Author Message
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 10:21am 30 Mar 2014
Copy link to clipboard 
Print this post

As a beginner, I bricked an ATmega32 40 pin microcontroller. It was my first attempt of going beyond Wiring language. The story is a little longer but to tell only a summary, I tried to write something on a 16x2 LCD using some "C" example. I got only garbage on display so, as a Microchip PIC programmer, I thought it may have something to do with the frequency settings (as you do bit configuration inside PIC). Of course, I got the fuse bits wrong and ignoring a warning message, I disabled the possibility to program the chip any further and disabled also the reset capability because my "math" was "correct" and I knew "better" than anyone. I threw the chip in my toolbox, got an ATmega644P to transform it into a Sanguino, and this time, I got it right.

But I want to use also the ATmega32 as I need to test the portability of my libraries/applications so, I searched for a parallel, high voltage programmer as it is the only method to revive an ATmega. I found that any option regarding a full featured HVP programmer is expensive or relatively difficult to build. So, I tried to find some automated "revivers". Those are some kind of HVP programmers but they manage only the fuse part (erasing chip, reading, writing, verifying fuses). It does need only a 12Vcc power supply as the firmware inside contains a little database about the chips it covers.

And I found it. Is free for personal use, easy to build, it covers 145 MCUs and important for me, the firmware is available also for ATmega168P MCU which I had available. Who cares it is not open source as long as you end up having your own AVR fusebit Doctor?



Now, to find the time to build it...
Edited by vasi 2014-03-31
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 11:16am 30 Mar 2014
Copy link to clipboard 
Print this post

But, if you can't go over "open-source" issue, here is an open-source alternative to the "AVR fusebit Doctor"'s firmware (written in Wiring language - just found it on Fritzing.org site). You can download it as zip archive - see the right panel. You have to download Fritzing if you intend to use your Arduino as a Doctor. Edited by vasi 2014-03-31
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 01:27pm 30 Mar 2014
Copy link to clipboard 
Print this post

If you try to compile "RescueAVR.ino" arduino code under Ubuntu 13.10 using the provided Arduino (which use a newer version of avr-gcc than the official one), you will get a lot of errors (the read-only data stored in flash must be explicitly declared as const). I've corrected them (compiles ok) and uploaded the archive here.

2014-03-30_232658_RescueAVR.ino.zip
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 712
Posted: 08:25pm 30 Mar 2014
Copy link to clipboard 
Print this post

Hi,

it is much easier to reset the AVR.

The only thing you need, is a 500khz to 2 MHz external oscillator.
Like a ne555, calib. Output of your oscilloscope, and so on.
Just feed the signal in the avr pin, where the quarz IS connected high side.
Then use your programmer an reset The fuses, ready.

 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 02:56am 31 Mar 2014
Copy link to clipboard 
Print this post

But if the fuses have been set to internal clock don't you still need a HV programmer?
Rob Gray, AKA the Graynomad, www.robgray.com
 
atmega8

Guru

Joined: 19/11/2013
Location: Germany
Posts: 712
Posted: 06:34am 31 Mar 2014
Copy link to clipboard 
Print this post

No,

only if you also kill " fuse" your reset pin .........


  graynomad said   But if the fuses have been set to internal clock don't you still need a HV programmer?
 
raketenbuggy
Newbie

Joined: 08/02/2014
Location: Germany
Posts: 21
Posted: 10:14am 01 Apr 2014
Copy link to clipboard 
Print this post

There are many ways to lock yourself out of an AVR using the FUSE bits.

- The most common way is to mess with the clock fuses. Then the method described by atmega8 is working fine.

- If you mess with RSTDISBL, SPIEN or DWEN you definitely need a HV-programmer (or a JTAG-Interface).

Some time ago I was looking for one and found this one:
http://elm-chan.org/works/avrx/report_e.html
The parallel programmer is a HVPP. It's the simplest solution I've found so far. I didn't try it because I got access to a STK500 back then.

A more elaborated version of ElmChan's circuit can be found here:
http://www.mikrocontroller.net/articles/AVR_HV-Programmer

Michael

EDIT: For Arduino there's an opensource solution:
http://mightyohm.com/blog/products/hv-rescue-shield-2-x/ Edited by raketenbuggy 2014-04-02
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024