| Author |
Message |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
06 Mar 2009 15:22 avrdude: initialization failed, rc=-1 |
|
|
|
|
First, I would check the bios settings for your parallel port.
If you don't know how, when you start your PC, you will see
"press del to enter setup" OR "press F1 to enter setup". Regardless, go into setup. You probably want advanced settings.
Just look at the settings for your parallel port. Try and get a screen shot of the settings screen & post it here.
You can also use debug.exe in DOS. I can't upload it here because I think its copywritten material.
First you need to check the output.
Wire up the anode through a 330 ohm resistor to the reset pin and the cathode to GND on your cable. (No avr connected)
copy debug.exe to your bootdisk.
boot from the disk into DOS, and type debug.
you will get a prompt: "_"
at the "_", type o 378 10
the LED should come on
Next, move the anode to MOSI pin on your ISP connector
at the "_", type o 378 20
the LED should come on
Next, move the anode to SCK pin on your ISP connector
at the "_", type o 378 40
the LED should come on
Now check the input pin, (MISO)
on your cable, join any one of the pins (MOSI, Reset, or SCK) to MISO.
at the "_", type o 378 FF
next, type
i 379
you should get a 0x7F byte back
next type o 378 0
now type i 379
you should get a 0x3F byte back
If this does not work, the bios settings may be wrong or your cable is not wired correctly, OR your port is defective.
What kind of PC is it?
|
|
| Back to top |
|
 |
ScOe
Joined: 26 Sep 2004 Posts: 83 Location: Zagreb
|
06 Mar 2009 16:09 locked atmega8 |
|
|
|
|
My PC is core2duo, intel P35, new bios update ... i'll try with debug and see what is going on .. well as for the cable, i tried with diode test on multimeter all pins. Cable is ok.
I've download debug.exe but cant insert it into a fusecd.iso .. which program are you using for editing iso image ? I tried with iso maker but when i insert file it removes boot sector ...
|
|
| Back to top |
|
 |
ScOe
Joined: 26 Sep 2004 Posts: 83 Location: Zagreb
|
07 Mar 2009 16:13 atmega168 reset disabled fix |
|
|
|
|
Ok, i've managed to find msdos cd with debug ...
Now i tried those steps but i didnt understand what i need to do with pin 10 (MISO).
Those three commands in debug lit the diode ... So, do i need to connect MISO to one of the other pins ? Just jumpwire it ?
Edited...
All is working well ... so port is ok and cable is ok ..
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
07 Mar 2009 18:06 atmega8 unlock |
|
|
|
|
| ScOe wrote: |
| All is working well ... so port is ok and cable is ok .. |
If this is the case then you should be able to program an avr with the cable. It is highly unlikely that you have disabled the SPIEN fuse in every single one of your avr's.
What is the error message when you are running the fuse restorer program? Are you sure you have the oscillator's output pin connected to XTAL1 pin on the avr?
Here is a test you can do.
Try to read the signature bytes on the avr. Use the fbprg16.exe disk. Do not connect the programmer when the disk boots. Wait until it fails. Go to the a: prompt in DOS.
Hook up the programmer. Run fbprg16.exe at the DOS prompt, and try to read the signature bytes. It does not matter if you select the right device. If you get an error, try to post a screen shot here.
You can also connect the xtal1 pin on the avr to pin 5 on the parallel port to see if your oscillator is shot. (this may/may not help)
|
|
| Back to top |
|
 |
ScOe
Joined: 26 Sep 2004 Posts: 83 Location: Zagreb
|
08 Mar 2009 11:17 fix atmega isp problem |
|
|
|
|
I started fbprg16 program and try to read signature while xtal1 connected to oscillator and it failed. I received 0xff 0xff 0xff 0xff as signature. That i connected xtal1 to parallel port pin5 and that gave something like 0x19 0xe. ... didnt wrote the output but it looked like it recognize chip signature. So it seemed that my oscillator is malfunction, but i've measure output freq of oscillator and it gave stable 4mhz as it should.
Oscillator is: 4mhz ecs-2100x
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
09 Mar 2009 2:53 atmel fuse resetter |
|
|
|
|
The signature bytes for an atmega8 are 1E 93 07. Even though FBPRG16 cannot read & write an avr that uses page read & write(most newer avr's) it will still be able to read the device ID. The command is the same in all avr's. I tried it with the programmer cable using the clock line from the parallel port on an atmega8, and it does work.
You can view the schematic when you are in FBPRG simply by selecting "show schematic". Triple check all your connections.
Otherwise, I do not know what to tell you. YOU REALLY SHOULD post a screenshot of your bios configuration for your parallel port. That way maybe someone will be able to help you.
Lastly, if you cannot get the parallel port to work, you must be able to get the serial port to work. You can use avr910 or the stk500. Sometimes the serial port is disabled in the bios. I had an IBM laptop that gave me NOTHING BUT HEADACHES with the serial port UNTIL I disabled the infrared detector. Its been great and trouble free since then.
You can also try another computer. I am sure you have a friend or colleague that will let you try the dos boot CD, just to give you piece of mind!
Your problem is challenging, but NOT impossible.
|
|
| Back to top |
|
 |
ScOe
Joined: 26 Sep 2004 Posts: 83 Location: Zagreb
|
10 Mar 2009 7:26 parallel programming locked mega atmel |
|
|
|
|
| Quote: |
The signature bytes for an atmega8 are 1E 93 07. Even though FBPRG16 cannot read & write an avr that uses page read & write(most newer avr's) it will still be able to read the device ID.
|
I was able to read device ID via parallel port clock, but while using external oscillator on xtal1 than it fail's. So than i tried fuse reset with xtal1 on parallel pin 5 and succeed. All locked avrs are now unlocked and ready for business!! Thanx !!
But now i dont understand why it failed to read chip with external oscillator ? Also, i would like to make that Avr910 programmer. Would it be possible to program Attiny2313 with that DOS proggy you uploaded ? It is hard to find 90s2313 (well at least with reasonable price. It is around 10$ here and tiny is 2$)
P.S. you deserved helped points
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
10 Mar 2009 18:16 restore attiny2313 to factory settings |
|
|
|
|
| ScOe wrote: |
| But now i dont understand why it failed to read chip with external oscillator ? |
Try unplugging the parallel cable, disconnect the power to the programmer, plug it all in and try again. Try it a few times. I think sometimes the reset may not be released or one of the data lines. The straight cable is not a very good design, but it is easy for people to use as an emergency (NOT IN WINDOWS!, with no drivers to worry about)
| ScOe wrote: |
Also, i would like to make that Avr910 programmer. Would it be possible to program Attiny2313 with that DOS proggy you uploaded ? It is hard to find 90s2313 (well at least with reasonable price. It is around 10$ here and tiny is 2$) |
I re-did the avr910 programming disk for the attiny2313.
****PLEASE observe the changes on the schematic****!
The only way I could test it was to use it on my homemade board. (that's the reason for the changes) The differences are the LED runs off PB2, and the board uses a 3.6864 crystal (not a 7.3728 MHz as in the previous schematic) The schematic has been included in these zip files and has been UPDATED. In fact the code that I posted before probably does not match the schematic. I will delete it.
The NEW hex file has the necessary changes for the attiny2313 to work as an avr910 programmer using the serial port. If you boot from the CD or the floppy (attached here), it will just program the code and the fuses PROPERLY to your avr attiny2313.
| ScOe wrote: |
P.S. you deserved helped points  |
Well I like to help. The fuses thing is complicated to say the least! Everything was great with the older avr's (the at90s series) then atmel had to go and make things complicated.
I myself had difficulty figuring it out because the CKSEL fuse settings in the attiny2313 datasheet (page 26 table 4) are shown as "CKSEL 3...1" in the table.
WELL there is NO MENTION of CKSEL0 in the table (it is in small print below) which I missed and was pulling my hair out trying to figure out why the device does not work!!!
So once you know your way around how to set the fuses, (and how to fix them) it is easy.
When I program any avr (and it works in my circuit) I take note of the 3 fuse bytes (Ext, HIGH & LOW) and copy those notes to the source file or folder, so next time I am not LOST.
Well I hope others can make use of these files.
Best of Luck
|
|
| Back to top |
|
 |
toddler
Joined: 12 Mar 2009 Posts: 1
|
14 Mar 2009 5:46 expected signature for atmega16 is 1e 94 03 |
|
|
|
|
| Quote: |
| 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 |
hey Tuxic ,
I am neww to avrs and locked up with my mega8
can u tell the software that can be used with DAPA Programmer.
I think I have mssed up with lock bits .Is there any way to restore them.
(It shows error -24 in pony prog )
|
|
| Back to top |
|
 |
vvaalleerraa
Joined: 01 Aug 2007 Posts: 1
|
18 Mar 2009 23:24 atmega spien disabled |
|
|
|
|
I had the same fuses problem with ATmega32. I had no 4Mhz generator and instead I programmed attiny13 to be a clock-source. tiny13 used internal RC-oscillator. On each timer overflow I changed portb's bit (output). Here are some hints that i've learned:
1) It turned out that only the slowest possible clock rate worked well (4Mhz int. osc., internal divider by 8, timer prescaler = 64, initial timer counter value = 0).
2) No need to make a new programmer. ISP worked in the same circuit where I programmed a wrong fuse.
3) attiny13-generator needed 33 Ohm resistor between the output port and atmega's XTAL1 (130.0+ didn't work in my 3.3V circuit)
4) desoldered only XTAL2 pin (keep open). Other circuit elements were still connected as in usual ISP-session.
5) no erasure needed. read fuse, write fuse.
6) It's a pleasure to know that in mega32 (and may be in all megas) its impossible to disable SPI programming by SPI programmer (i.e. to change SPIEN fuse).
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
19 Mar 2009 1:38 reset fuse bits atmega128 |
|
|
|
|
| vvaalleerraa wrote: |
| No need to make a new programmer. ISP worked in the same circuit where I programmed a wrong fuse. |
I agree, however some people have trouble with windows drivers. This was the reason for the DOS program, and the easiest cable to build.
|
|
| Back to top |
|
 |
Microtronic
Joined: 10 Jun 2007 Posts: 11 Location: Venezuela
|
19 Mar 2009 3:16 avrdude atmega168p |
|
|
|
|
Unlock somes atmega8.
http://www.artem.ru/cgi-bin/news?c=v&id=739
|
|
| Back to top |
|
 |
eandino
Joined: 03 Apr 2009 Posts: 1
|
04 Apr 2009 0:53 erase 90s2313 |
|
|
|
|
HI ... I am new in the forum ... I hope somebody could help me with my issue.
I got my ATMEGA8 locked because of some misleading fuse programming, I don t remember what fuses I changed, so I was hoping the program you sent would recover it, and as I read before, it probably will
The problem is that I dont have a floppy disk drive, and I can not boot the program from the CD (I dont know why,,, It just doesn t). Does anybody have the program in a not bootable version?
Thanks for your time ...
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
04 Apr 2009 2:37 parallel fuse programmer cable atmel fix |
|
|
|
|
| eandino wrote: |
| I can not boot the program from the CD (I dont know why,,, It just doesn t). Does anybody have the program in a not bootable version? |
you need to go into the setup when your computer starts and change the setting in the bios to boot from the CD. It is strictly a DOS only program.
you can also use the same program that you originally used to program the avr, just install an oscillator to supply the clock to the atmega 8, then reprogram the fuses. The default fuses are: Fuse Low = 0xC1, Fuse High = 0x99
Look back on the first page of this thread, you will see a diagram with part numbers.
|
|
| Back to top |
|
 |
srikanthsamaga
Joined: 14 Dec 2008 Posts: 101 Helped: 4 Location: Mangalore
|
05 Apr 2009 2:16 tiny2313 unlock |
|
|
|
|
| ctownsend wrote: |
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 |
Works only when clock fuse bits are programmed wrongly..
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
05 Apr 2009 23:01 stk500v2 usb programming atmega8 |
|
|
|
|
| srikanthsamaga wrote: |
| Works only when clock fuse bits are programmed wrongly.. |
Yes that is correct. However it is impossible to disable the SPIEN fuse in ISP mode.
Unless one of the other fuses was programmed (DWEN, or RSTDISBL) the above method will always work.
If not you need a parallel programmer.
|
|
| Back to top |
|
 |
BrianKHud
Joined: 12 Apr 2009 Posts: 1
|
12 Apr 2009 9:46 avr atmega8 cannot enter programming mode |
|
|
|
|
ctownsend - it sounds like you've really helped out some folks here!
Let me explain my fun predicament, and see if you can be equally helpful to me
I just purchased a sensor board (gyros, accelerometers) with an on-board atmel168 chip. I've worked with micros in the past, but it was all parallax stuff. I'm not an expert, but I don't think I'm dummy either (I brought up the parallax from scratch with breadboard, crystals, and LEDs and wrote a crapload of assembly for it)
I also bought an Arduino and I plan to interface the sensor board with the Arduino. However, the code on the sensor board wasn't quite to my liking, so I wanted to update it via ISP.
I was too cheap to buy a real programmer, so I found this code to turn my arduino into a programmer - so cool! http://code.google.com/p/mega-isp/ This worked ok, but was kind of flaky - worked sometimes, not others. Of course, at some point I was programming and got a warning about my fuses not matching from AVRDude. I confirmed to have AVRDude fix it, but it just hung the board. Now when I try to read / write anything in AVRDude the chip signature is showing up as 0x000000. Incidentally, if I disconnect MISO and MOSI, I get the same behavior from AVRDude, so I'm assuming the chip on the sensor board isn't "responding" at all.
I can show you the schematic of the board I'm working with if you want, but it's a pretty simple crystal system driven by a ATMega168 connected to a 16Mhz crysal.
The pain is that this is an SMD ATMega168 - not something I can easily pop-off and reprogram, or even replace. If I de-solder one side of the crystal, modify the mega-isp Arduino program to put out a 4Mhz square wave generator on one of the pins and connect that to the xtal input on the ATMega, are you saying I can just use the same programmer I was using?
Alternately, I guess I could make your parallel port cable and use my Arduino just for the 4Mhz clock.
I'm feeling hopeful after reading this thread - I was really worried I had irreversibly damanged my sensor board, and its sounding like I have a chance to fix it!
Do you think there is a way I could reset the fuses using my Arduino, or should I go straight for the parallel port solution?
|
|
| Back to top |
|
 |
srikanthsamaga
Joined: 14 Dec 2008 Posts: 101 Helped: 4 Location: Mangalore
|
13 Apr 2009 1:27 avrisp+mkll+entring prgramming mode |
|
|
|
|
| since you don't know which fuses you have set wrongly, it is better to choose parallel programmer..
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
13 Apr 2009 4:12 atmega128 fusebit unlock |
|
|
|
|
| srikanthsamaga wrote: |
| since you don't know which fuses you have set wrongly, it is better to choose parallel programmer.. |
Not really an easy option if the device is an smd package.
| BrianKHud wrote: |
| The pain is that this is an SMD ATMega168 - not something I can easily pop-off and reprogram, or even replace. |
| BrianKHud wrote: |
| If I de-solder one side of the crystal, modify the mega-isp Arduino program to put out a 4Mhz square wave generator on one of the pins and connect that to the xtal input on the ATMega, are you saying I can just use the same programmer I was using? |
YES, you can do it that way but I wouldn't modify the program, its easier to just use an oscillator on the xtal1 pin of your atmega, then reprogram the fuses to the default values and you are back in.
If you previously programmed the security bits you will have to erase the atmega first before reprogramming the fuses.
Now this will not work if you accidentally programmed the rstdisbl fuse or the spien fuse. In this case you will need to remove the device and use a parallel programming adapter or just replace the device (easier & cheaper)
Let us know how it goes.
Good Luck
|
|
| Back to top |
|
 |
Fragrance
Joined: 26 Jul 2002 Posts: 1385 Helped: 24
|
17 Apr 2009 8:16 atmega32 wont erase |
|
|
|
|
Hi
It is better to used SinaProg 1.2.5.6 which has fuse byte calculator repair fuse read fuse write fuse and support all famous hardware
http://www.microstar.ir/download/SinaProg.zip
http://rapidshare.com/files/221493168/SinaProg.zip.html
Regards
Fragrance
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
|
| Back to top |
|
 |
ScOe
Joined: 26 Sep 2004 Posts: 83 Location: Zagreb
|
21 Apr 2009 20:14 atmega168 program fuses |
|
|
|
|
wow .. that looks like a problem solver, if it works
|
|
| Back to top |
|
 |
jcarpio
Joined: 23 Apr 2009 Posts: 1
|
23 Apr 2009 18:05 atmega8 minimum schematic |
|
|
|
|
Unable to read Device Signature with SinaProg. Any idea?
Thanks in advance.
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
24 Apr 2009 1:57 avr fuses repair |
|
|
|
|
| jcarpio wrote: |
Unable to read Device Signature with SinaProg. Any idea?
Thanks in advance. |
all that program is, is a GUI for avrdude. You will still have the windows driver problems just like always. Sinaprog worked for me on one computer but NOT on the computer I usually do my programming.
The best way to restore fuses is a High Voltage parallel programmer. Secondly, the method above will work as long as the SPIEN or the RSTDISBL fuses are not programmed.
The above method works in dos, so there are no windows driver problems. The cable is very easy to build and only needs a few parts.
I always go for the simplest solution.
|
|
| Back to top |
|
 |
pranam77
Joined: 22 Apr 2008 Posts: 1071 Helped: 94 Location: Mangalore(India)
|
24 Apr 2009 6:54 timeoutsupported programmer not found |
|
|
|
|
| ctownsend wrote: |
| jcarpio wrote: |
Unable to read Device Signature with SinaProg. Any idea?
Thanks in advance. |
all that program is, is a GUI for avrdude. You will still have the windows driver problems just like always. Sinaprog worked for me on one computer but NOT on the computer I usually do my programming. |
Yes..Sinaprog didnt detect the USB ASP when worked with my laptop.
|
|
| Back to top |
|
 |
Fragrance
Joined: 26 Jul 2002 Posts: 1385 Helped: 24
|
24 Apr 2009 8:47 crystal oscillators atmega capacitor |
|
|
|
|
or built this nice hardware
http://home.ict.nl/~fredkrom/pe0fko/Fuse-restore-ATtiny45/
http://cappels.org/dproj/t12fp/t12f.htm
regards
Fragrance
|
|
| Back to top |
|
 |
imam.sumarsono
Joined: 29 Apr 2009 Posts: 9
|
29 Apr 2009 10:13 attiny2313 device signature = 0xffffff |
|
|
|
|
Hi, I am new in this forum
last time my ATMEGA8 has locked, and so i search how to unlock my microcontroller.
And now, my ATMEGA8 has already unlock.
This is step by step how to unlock my ATMEGA:
1. Open ponyprog serial device programmer
2. Connect the ATMEGA8 to pc (parallel port)
3. Click security and configuration bit
4. fill using this number :
WDTON : 1
SPIEN : 0 (cannot be changed)
CKOPT : 1
EESAVE : 1
BOOTSZ1 : 0
BOOTSZ0 : 0
BOOTRST : 1
BODLEVEL : 1
BODEN : 1
SUT1 : 1
SUT0 : 0
CKSEL3 : 0
CKSEL2 : 0
CKSEL1 : 0
CKSEL0 : 1
5. (This is the inportant thing that must do)
touch XTAL1 (and also) XTAL2 using your finger
and at the same time click "write" ....
6. ATMEGA8 can write the program again.
note : ATMEGA8 pin must not connected to other excep VCC, gnd, reset,miso,mosi,sck pin.
I hope this can solve your problem
regards,
-Imam-
|
|
| Back to top |
|
 |
Google AdSense

|
29 Apr 2009 10:13 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
29 Apr 2009 12:09 spien atmega88 disable |
|
|
|
|
| imam.sumarsono wrote: |
5. (This is the inportant thing that must do)
touch XTAL1 (and also) XTAL2 using your finger
and at the same time click "write" ....
6. ATMEGA8 can write the program again.
regards,
-Imam- |
you've gotta be kidding!
|
|
| Back to top |
|
 |
imam.sumarsono
Joined: 29 Apr 2009 Posts: 9
|
30 Apr 2009 1:49 reset fuses hv atmega |
|
|
|
|
| ctownsend wrote: |
| imam.sumarsono wrote: |
5. (This is the inportant thing that must do)
touch XTAL1 (and also) XTAL2 using your finger
and at the same time click "write" ....
6. ATMEGA8 can write the program again.
regards,
-Imam- |
you've gotta be kidding! |
no, I am not kidding, as you know, our finger can supply frequency about 50Hz, I think it is why it is can write to ATMEGA. I have try this and 100% success
CMIIW
regards,
-Imam-
|
|
| Back to top |
|
 |
simpsonss
Joined: 30 Jul 2008 Posts: 1
|
08 May 2009 8:15 fuse bit setting for atmega32 |
|
|
|
|
hi ctownsend,
i'm facing this problem too. i have a labtool with me. But how am i gonna erase all the fuse bit? i try to execute the erase option but still not working.
thank you.
|
|
| Back to top |
|
 |