How do I set the clock speed fuses on an ATtiny85 when using an Arduino as a programmer?

I'm using Arduino UNO + ArduinoISP successfully.

Add -U flags to your avrdude command to set any or all of the three ATtiny fuses.

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

The clock selection is done in bits[3:0] on the third fuse ('Fuse Low Byte'). Set them as follows to make use of an external crystal (of 8MHz or faster):

-U lfuse:w:0x6f:m

Its definition (I infer) must be something like: [Fuse Low Byte]:[write]:[hex value]:[set manually]

The default value for the four high bits of this byte are 0110, so leave the 6 in 0x6f as it is, and only change the second digit, the f (its default value is 2).

NB: If your processes take longer or shorter than you expect, check your clock prescaler and your definition of F_ CPU.


Try using the related tutorial by the same group (MIT's High-Low Tech) entitled Programming an ATtiny w/ Arduino 1.0.

A quick summary: From the Tools-> Board menu in the Arduino IDE, select the ATtiny85 and the frequency you wish to run at (1 or 8 Mhz internal clock, or 20Mhz external crystal) and then use the Tools -> Burn Bootloader". I believe selecting the desired speed board modifies the way the delay() and other time-related Arduino functions work in order to sync up with the clock speed.

I have had success with this approach myself using some ATtiny84 chips. The simple blink program is fixed, as well as more sensitive timing required for manually controlling pulses sent to a servo using delayMicroseconds().


I believe the Arduino software (libraries and all) assumes you are operating at 16MHz. If you apply that assumption to the clock you are actually running at... things should work out. Assuming you are running the Tiny85 on it's internal oscillator I think it runs at 1MHz, so just multiply all your delay statements (and other notions of time) by 16.

If you need better accuracy than the internal oscillator provides you should think about using an external crystal or a resonator, but you will need to change the fuse settings of the AVR for that to work, and I think you will need a programmer like the AVRISP mkII to do that with AVR Studio (my recommendation).

I don't know much about the ArduinoISP sketch but to me it looks like it bit bangs the ISP protocol to upload a program to the target chip (not the on board Mega328), not sure it is equipped to manipulate fuses. ArduinoISP is documented here http://arduino.cc/en/Tutorial/ArduinoISP, fwiw. Note that you can't use a UNO currently to run the ArduinoISP sketch. It doesn't look to me like you can use the sketch to make the Arduino a viable interface for using the AVR Studio GUI tools.

EDIT: It looks like stuff has caught up and an UNO is viable for ArduinoISP now - thanks for the comments all