electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Locked Atmega ...


Goto page 1, 2, 3  Next
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Locked Atmega ...
Author Message
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post05 Aug 2008 17:03   

atmega fuse repair programmer


Is it possible to reset or do something with locked Atmega 8. What i mean by locked is that while programming something happened and chip got locked. Now i cant erase it, reprogram it or do anything with it. Well at least not with standard ISP programmer. So is there anything i can do accept throwing it in trash ? Smile
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5154
Helped: 766
Location: Bochum, Germany


Post05 Aug 2008 17:59   

locked atmega


What probably has happened is an unintended reset of the SPIEN fuse. If so, a parallel programmer would be needed to reenable SPI programming.
Back to top
nandhu015



Joined: 11 Feb 2006
Posts: 640
Helped: 46
Location: Tamilnadu, India


Post05 Aug 2008 18:35   

atmega reset fuses


Most of the time the fuse bits get programmed wrongly. The only way to bring it back is using high voltage parallel programming.

Some times when only clk select fuses got messed up, we can use an external crystal.

Regards
nandhu
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post05 Aug 2008 21:10   

atmega fuse recovery


hook up an oscillator (not a crystal) to the clock line on the atmega.
(any freq, usually 4MHZ)
erase the device with your ISP program, then reprogram the CLSEL fuse.

The above works 99.99% of the time!

Good Luck
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post05 Aug 2008 21:32   

atmega 128l signature 0xffffff


Does the oscillator connects to atmega same way as crystal does? (2x22pf grounded)
CLSEL fuse is Clock select ?
Back to top
Google
AdSense
Google Adsense




Post05 Aug 2008 21:32   

Ads




Back to top
nandhu015



Joined: 11 Feb 2006
Posts: 640
Helped: 46
Location: Tamilnadu, India


Post06 Aug 2008 1:46   

bricked atmega fuses


Quote:
Does the oscillator connects to atmega same way as crystal does? (2x22pf grounded)


No need for capacitor if you use oscillator.

Quote:
CLSEL fuse is Clock select ?


Yes it is

Nandhu
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post06 Aug 2008 12:41   

attiny2313 reset fuse isp 12v


Do this. I am 100% confident that it will fix the problem.
Erase with your ISP program, then program the CLSEL fuse, and it's fixed.



Sorry, but you need login in to view this attachment

Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post06 Aug 2008 12:48   

atmega8 reset fuses


Ok, thanx .. i'll give it a try as soon as i receive oscillator ...
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post16 Oct 2008 13:05   

atmega program fuse recovery


ScOe wrote:
Ok, thanx .. i'll give it a try as soon as i receive oscillator ...


you should post your result so others may benefit. That is what these forums are all about!
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post16 Oct 2008 13:58   

atmega8 fuse reset


Quote:
you should post your result so others may benefit. That is what these forums are all about!


Sorry, forgot about it ... I was trying to find e-shop that sells oscillators, but couldnt find any that has acceptable price-shipping ratio, so i cold feeted with that project. It is shame, though, cause i have "locked" board that is around atmega128 and it is kindda expensive to throw it away. I'll try to find osc again, thanks for reminder Smile
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post20 Feb 2009 23:04   

ponyprog and rstdisbl


I found 4Mhz oscillator, connected it to xtal1 and tried to use STK500 to erase fuses, but it seems that my STK doesnt work. i've bought it few months ago, havent used it yet, now im not sure if the problem is with stk or uC.

Is there any good method to check if STK is working ?

I tried to use it with avrdude as:
>avrdude -p m16 -P com6 -v -c STK500v2 -F -B 32
and receive this:

//info about stk and chip which i skipped to shorten post
//and this is the part that is interesting ...
avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA16 is 1E 94 03
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF

avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as FF
avrdude: safemode: Fuses OK

avrdude done. Thank you.

Tried it on another locked mega16 and on one atmega128 board, and get same thing while reading it ...

Can anyone post minimum system configuration schematic so i can verify if my stk if working.
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post21 Feb 2009 7:34   

fuses reset atmega


I was working with an atmega16 just the other day and I could not get avrdude or avrprog to work. This program works good.

Select detect to see if it detects your atmega.

Good Luck



Sorry, but you need login in to view this attachment

Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post21 Feb 2009 8:45   

reset fuse bit for atmega128 with hv parallel


Hrm, that program doesnt work either .. when i select detect i get this msg:

Checking programmer type ...
Timeout during COM-port read operation!
Supported programmer not found on Com Port 2

Programmer is on port Com2, cause i tried to connect to it from avrstudio. It connects to programmer, it updated firmware on it, but cant enter programming mode.

AVRStudio show this errors:

Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. FAILED!

Is that means that my STK is malfunction ?

I'm getting tired of ISP-s Smile i've build avr duper board and tried to program atmega8 via EasyAVR, everything seems ok, but windows doesnt recognize device ..

Can anyone post a serial port isp design with layout that works 100% Smile Also, it would be good if layout is single layer. I'm using photo transfer method for developing boards, but didnt practice enough on two layer boards...

Thanx
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post21 Feb 2009 22:19   

clear spien for atmega128


Can you program any avr's with AVR Studio? If you can't, I am afraid your programmer is "bricked".

This happened to me and many others when AVR Studio updated the software in the programmer. The recovery procedure is in AVRStudio, under: "Help/AVR Tools Users Guide/AVRISP Users Guide/Manual Firmware Upgrade. "

I myself had an atavrisp that went south the minute it took an update from avrstudio. I managed to fix it by manually updating it. The trouble is the power source + & - should only be connected when upgrading and NO other signal lines (i.e. MISO, MOSI, SCK, RST, etc)

You might find similar solutions for your stk500 in the avrstudio help menu, or ask on avrfreaks.com.

I use an avr910 programmer I built myself. AVRPROG does not recognize the atmega16, but the above program I uploaded does, and it works great.

You can use the avr910 on avrdude as well.

Good Luck
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post01 Mar 2009 10:55   

unlock fuse bit atmega8


ctownsend: do you have avr910 layout ?

I'm not sure if i'm doing something wrong or what... I've build parallel programmer and it doesnt recognize any AVR chip. Also i have two avrisp, avrduper on which i cant upload firmware. (well i upload it, but windows still doesnt recognize usb device) and i have that stk500 which is bricked. All i have left is EasyAVR3 board but i cannot reset fuses with it ...
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post04 Mar 2009 3:51   

how to unlock atmega16 with ponyprog


here is all you need for avr910. This firmware will work in a AT90S2313 and probably an attiny2313, however the programmer cable you need to build to "program the programmer" will only work with the at90S2313.

***EDIT*** see the post on March 10, there is a new file and schematic for the attiny2313 to work as avr910*****

This is the easiest programmer for any avr, unfortunately it only supports older avr's that are hard to find.

Attached are the avr910 schematic, and all docs pertaining to avr910. Also included is the hex file that belongs in the micro controller for avr910.

I also included a very easy programmer cable you can build with just 3 resistors that will program the 90s2313 so you can get the avr910 code programmed in the 90S2313. In the FBPRG.zip file you will find a schematic of the cable and a boot floppy image. Run the exe file and it will create a DOS boot disk for you.

Once you have the cable connected to the 90S2313, put the boot disk in, and start your pc. It will erase, program and verify your 90S2313 all on its own. I use this on a pentium 4, 2GHz machine and it never fails. If it does not work for you, then try supplying the 90S2313 with a separate CLEAN 5V power supply. If you do this, make certain you disconnect the 3 resistors going to your parallel port!!

ALSO:
give me a list of the avr's you cannot program. I am working on a VERY SIMPLE way to fix the CKSEL fuse problem (I myself pulled out my hair last week programming an atmega16, but I have an expensive Labtool 48XP Parallel programmer to reprogram the CKSEL fuses if they get messed up)

I should have a solution in the next few days using the simple FBPRG cable in the fbprg zip file attached here.

Good Luck



Sorry, but you need login in to view this attachment



Last edited by ctownsend on 10 Mar 2009 18:20; edited 1 time in total
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post04 Mar 2009 9:25   

fuse bits expected signature


Thanx, ill give it a try.

Well i', struggling with Atmega16 on which i have selected external low-freq crystal (dont know why Smile ), also one Atmega8 and one old mega 8535 on which i mistakenly press reset button while it was in program mode. There is also one Atmega128 and Atmega32 that i cant verify if they are alive or not cause all of my ISP programmers doesnt work.

Ill try to convert your startup program for usb boot, cause i dont have floppy on any of my PC's. If it only needs direct access to interrupts, ill try with Hirens boot disk to go to dos mode.

I'll let you know how it went.
Back to top
Tuxic



Joined: 11 Dec 2007
Posts: 8


Post04 Mar 2009 14:12   

attiny2313 restorer


Although it now sounds like a problem with your dev board, you didn't need to buy an oscillator. You could have programmed another AVR to act as an oscillator, and save you the trouble of shipping costs etc. ATtiny24 costs something in the region of 90pence (0.90 GBP), but a spare mega8 would have sufficed.

Here's a schematic for a stupidly simple (but occasionally dangerous) programmer cable that uses the parallel port (Also Here). I use this one myself and it works fine (sometimes it kills an AVR due to it being an unbuffered design). Although a buffered cable is advisable.



Sorry, but you need login in to view this attachment

Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post04 Mar 2009 17:11   

reseting fuse on atmega8


Try these files. One is an ISO image for a CD (if you don't have a floppy) and one is a floppy image. Your PC must have a parallel port. I really don't know if it will work with a usb to parallel adapter. Please let me know if it does.

If you build the cable exactly as in the schematic, it will work always (provided you have no parallel port problems or you didn't disable the spien fuse!)

Just insert floppy or CD, and hook up the programming cable. Select device to restore and that's it. You must boot from this disk! Do not run in windows!!

I tested every one of the devices in the list and they all work, even on my pentium 4, 2GHz machine.

What this does is restore fuse settings back to factory settings, You can do this with any avr ISP programmer, however the cable is very simple to build and since it works in PURE DOS, you won't have the dreaded driver permissions headache in windows!

You can add devices in the list by modifying the menu. Or just add batch files and run them in straight dos.

Attached is also a screen shot of the program.

There are lots of "more glorified" ways of doing this, HOWEVER, the cable is so easy to build and costs practically nothing. I always find the simple things work the best when you run into problems.

Good Luck

P.S. You don't need the exact same oscillator as in the schematic. As long as you stay within the limits of your avr, it should be fine. You can use anywhere from 1 MHz - whatever speed your avr will operate at reliably.



Sorry, but you need login in to view this attachment



Last edited by ctownsend on 04 Mar 2009 17:35; edited 1 time in total
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post04 Mar 2009 17:31   

avreal erase attiny2313


Tuxic wrote:
Although it now sounds like a problem with your dev board, you didn't need to buy an oscillator. You could have programmed another AVR to act as an oscillator, and save you the trouble of shipping costs etc. ATtiny24 costs something in the region of 90pence (0.90 GBP), but a spare mega8 would have sufficed.

Here's a schematic for a stupidly simple (but occasionally dangerous) programmer cable that uses the parallel port (Also Here). I use this one myself and it works fine (sometimes it kills an AVR due to it being an unbuffered design). Although a buffered cable is advisable.


how is he going to program the attiny24 if his programmer is not working?
If you are going to order an attiny24 and pay shipping costs, you may as well just order the oscillator and be done with it. I think for some people writing the code to simulate an oscillator would a great deal more difficult than just buying the right part.

And besides you can always pull one off an old junk electronic device for free.

Also do you not think a simple exe program for dos is easier than whatever you posted above? Forgive me for sounding stupid, but how do you run this? Does it need to be compiled?

Is that easier?
Back to top
bohumilfulin



Joined: 10 Feb 2005
Posts: 30


Post04 Mar 2009 17:39   

atmega16 factory restore


Ctownsend excellent idea!!! All my AVRs unlocked!!! Bottle of whisky is reday for you in Prague!

For anybody else. I put 100R resistor between AVR and clock source for safety. my programmer did just two processes:
1. erase mcu
2. reprogram all lock and fuse bits

Unsoldering Xtall and capacitors is not necessary

I used my homemade programmer.

Thank you once again for sharing Ctownsend!!!

b
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post04 Mar 2009 17:41   

atmega88 device signature


bohumilfulin wrote:
Ctownsend excellent idea!!! All my AVRs unlocked!!! Bottle of whisky is reday for you in Prague!


any Canadian whiskey in Prague? Smile)
Back to top
bohumilfulin



Joined: 10 Feb 2005
Posts: 30


Post04 Mar 2009 22:38   

pony cksel attiny2313


be sure.
but Canadian?

As I can see, you urgently need a scottish single malt whisky training. Also we add cigars smoking and beer pub crawl.

Normal triathlon.

cheers!
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post04 Mar 2009 23:11   

fuse restore attiny2313


Wow, so we have a party in Prag? Ok, i can be there in about 4hours if i catch the next flight Smile

I'll try CD thing ...
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post04 Mar 2009 23:19   

save source code from a locked attiny2313


ScOe wrote:
So you say i can use any crystal for chip i'm going to program ? 4Mhz will be ok ? Well i have 4mhz oscillator as it came few weeks ago so basically i just connect output of oscillator to xtal1 or xtal2 ? or is it the same ?


NO, you MUST use an oscillator. As long as the frequency is within the limits of the avr, (the lower the value the better) A crystal will not work. Connect the output of the oscillator to xtal1 of the avr.

Here is another version that does many more avr's. It works. I fixed all the messed up avr's I have here.

Remember to boot from the disk, do not run in windows.

Good Luck



Sorry, but you need login in to view this attachment



Last edited by ctownsend on 04 Mar 2009 23:34; edited 1 time in total
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post04 Mar 2009 23:30   

avrdude yikes


Ok, thanx ... Yeah i saw i need to use oscillator as soon as i opened .zip file and saw schematic Smile

I'll play with it tomorrow as it is quite late here Smile
Back to top
Tuxic



Joined: 11 Dec 2007
Posts: 8


Post05 Mar 2009 3:04   

unlock attiny2313


ctownsend wrote:
how is he going to program the attiny24 if his programmer is not working?
If you are going to order an attiny24 and pay shipping costs, you may as well just order the oscillator and be done with it. I think for some people writing the code to simulate an oscillator would a great deal more difficult than just buying the right part.

And besides you can always pull one off an old junk electronic device for free.

Also do you not think a simple exe program for dos is easier than whatever you posted above? Forgive me for sounding stupid, but how do you run this? Does it need to be compiled?

Is that easier?

Firstly, my grammar indicated a recognition that ScOe's programmer was not working. Secondly, I was throwing an idea into the ring. As far as I am aware, I was trying to be helpful by suggesting another alternative to buying an oscillator. I did not make a demand that an ATtiny24 be bought. Also, I noted that ScOe has other AVRs available to him/her, as the other posts have indicated. Maybe programming an AVR to act as an oscillator would be overly complex, but if a spare AVR happens to exist in ones component trays, then it saves buying something and be burdened with P&P charges.

What I have posted is a .zip file. It contains a jpeg, text files, a postscript file, a gschem symbol file and a gschem schematic file (all that information is provided by the README file in the .zip archive.) There are no code files at all. It is simply a re-package of one of my project archives for convenient downloading. I normally roll Bunzip2 compressed "Tape ARchive" (tar) file instead (in .tar.bz2 extension), but EDA Board wont allow one of those to be posted. A tar file is a Unix archiving file, much like .zip, .rar etc. except that it doesn't compress without a compressing library such as bunzip2 or gunzip. WinRAR can easily handle a .tar.bz2 (can also be labeled .tbz2), for those who use Windows rather than a Unix variant.

Besides, .exe files tend to be Windows executable binary files. I am not a Windows user. Thus, I have no reason to program for, or be in the possession of any .exe files (although I am in possession of some as I run some Windows only programs via virtual machines and emulators.) I am aware that you have no way of being aware of my not being a Windows user, but I would appreciate not having my throat jumped down for trying to offer my two pence.

Thanks,
Nathaniel.
Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post05 Mar 2009 13:26   

ponyprog unlock atmega


I tried your fusefix dos proggy but it failed to do anything... I received message:
Quote:
cant resync
Reset pin released


Ive meassured voltage on reset pin and it always stay high. There is no low period while reseting avr... I dont have other mobo with parallel port. Now that would be a charm if i need to buy another mobo just to clear the fuses on few chips Wink

Usb to parallel will not work cause dos would have to have driver for usb chip to interpret commands to lpt...

Can atmel original stk500 or mkii repair fuses? Im going mad with homemade programmers that doesnt work...
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post05 Mar 2009 17:34   

unlock atmega8


ScOe wrote:
Ive meassured voltage on reset pin and it always stay high. There is no low period while reseting avr.
The reset is brought low and then high very fast, so you cannot measure it with a voltmeter.
ScOe wrote:
Can atmel original stk500 or mkii repair fuses? Im going mad with homemade programmers that doesnt work...

Any avr ISP programmer can reprogram fuses as long as you have an oscillator connected to xtal1 on your avr. (provided you did not disable the SPIEN fuse, in which case you need a high voltage parallel programmer.)
The STK500 IS a high voltage parallel programmer.

Sounds like you have a parallel port problem. IF avreal does not work from the boot disk, either your cable is assembled incorrectly OR your parallel port is disabled in the bios, OR you have disabled the SPIEN fuse in every single one of your avr's (which is highly unlikely).

look here for some troubleshooting tips.http://booksbybibin.14.forumer.com/viewtopic.php?t=6

Here is a program you can run in DOS (again another boot CD) that will display the status of your parallel port. If it does not detect a port, your port is either disabled in the bios or it is not working.

My disclaimer:
***Be careful when connecting the pins on the loopback*****
Read the doc file!!! Do not blame me if you blow your parallel port by not reading the instructions.

If your port is working, the results should look exactly like the screenshot (attached)



Sorry, but you need login in to view this attachment

Back to top
ScOe



Joined: 26 Sep 2004
Posts: 83
Location: Zagreb


Post05 Mar 2009 23:18   

atmega16 fuses


Well it seems i have parallel port problem .. dont know if i can fix that ..
This image shows status of parallel program.



Sorry, but you need login in to view this attachment

Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Locked Atmega ...
Page 1 of 3 All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Similar topics:
about Injection locked oscillator and injection locked pll (1)
Frequency Locked Loop and Phase Locked Loop (2)
atmega (3)
ATMEGA 32 (2)
atmega 8 (4)
ADC on Atmega (5)
about atmega (3)
Programming ATMega (6)
ATMEGA Help (4)
Atmega programmer (3)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS