1
\$\begingroup\$

I changed the clock fuse bits on my ATtiny85. Now I can't flash anything to it or even change the fuse back. I get the error:

avrdude.exe: Device signature = 0x000000
avrdude.exe: Yikes!  Invalid device signature.
             Double check connections and try again, or use -F to override
             this check.

The command line command I used to change the fuse initially was:

avrdude -p attiny85 -P com8     -c stk500v1    -b 19200 -U lfuse:w:0x62:m -U flash:w:main.hex

Now I understand that I set the clock fuse for an oscillating clock signal, not for a crystal. I read here that I can supply the necessary clock signal from an stk500. My Arduino UNO is functioning as programmer (and in the command line args, I actually tell avrdude that it's an stk500). How do I connect/configure UNO and ATtiny to supply the necessary clock signal?

EDIT

I'm not trying to use High Voltage Parallel Programming. I just want to supply the external clock signal which the AVR now expects in order to program it as normal.

I have a second Arduino, and I tried to send a 16MHz square wave to pin 2 (CLK1) of the ATtiny85, using the code on this page. However, when I tried to program the AVR with both Arduinos hooked up to it (both the clock and the programmer), I got the same error as before. Any idea what's wrong?

\$\endgroup\$
  • \$\begingroup\$ Did you read about the high voltage part of the post you linked to? That's what you need to do. Are you sure that Arduino can provide +12 V directly (I think that it can't but I never used it). \$\endgroup\$ – AndrejaKo May 30 '12 at 22:52
  • \$\begingroup\$ An arduino cannot supply 12V on its own. Unless you have a 12V power supply and use a transistor to switch on and off. \$\endgroup\$ – Shungun May 31 '12 at 2:15
  • \$\begingroup\$ Do you mean that I need 12V for the clock signal? I interpreted the article to say I only need 12V if I want to fix the problem via High Voltage Parallel Programming, but I should be able to avoid that entirely and program the AVR as normal if I can just supply the desired clock signal, right? See my edit above. \$\endgroup\$ – JellicleCat May 31 '12 at 2:19
2
\$\begingroup\$

The guys on the Arduino forums helped me out. Apparently, my code was not creating PWM. Otherwise the concept is sound. Here's their answer and all of my steps.

\$\endgroup\$
1
\$\begingroup\$

Actually, if the command you entered is really what you used, then you did not set the fuse for an external clock source of any kind. Low fuse byte of 0x62 is the default fuse setting for the ATtiny85 device which uses the internal 8MHz oscillator. You can easily verify this in the data sheet or on this website which is a great tool for figuring out the correct fuses:

http://www.engbedded.com/fusecalc

You would normally define the MCU frequency in the MAKEFILE, but I'm not sure how that works with Arduino. Then, you wouldn't need to specify the baud rate (-b 19200) as this would be figured out by the programmer and AVRDUDE.

If you really can't communicate with the device at all any more, then you may have to use a HVSP to reset the fuses to default. I have built one for this purpose.. it is not that difficult if you know much of anything about the AVR devices. Here is a website detailing some of the steps:

http://www.simpleavr.com/avr/hvsp-fuse-resetter

\$\endgroup\$
  • \$\begingroup\$ You were right about the meaning of 0x62 (I guess that I actually set the fuse to 0x60). And thanks for the hvsp fuse resetter instructions. \$\endgroup\$ – JellicleCat May 2 '13 at 2:58
0
\$\begingroup\$

Looking at the fuses section of the datasheet, these fuses might interest you:

  • CKOUT - outputs the devices clock on CLKO pin. This should be perfect for supplying the damaged device with a clock from the working Arduino. If still problems, try supplying slower clock (for example 1 MHz)

  • RSTDISBL and SPIEN - I recommend you never touch these fuses - else you will need high voltage serial programming to recover (been there)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.