Reprogramming a ATTINY85 to use an external oscillator using the Arduino IDE

I’d read about using PIC series microprocessors as clock dividers. For a project I’ve been working on I wanted to do the same thing. I find working with PICs pretty painful so I thought I’d use the Attiny85 from a digispark I have.

The process is pretty straightforward, but I wanted to document it here.

In order to reprogram the ATTINY85 to use a different oscillator, you need an AVR programmer. It’s not possible to set the fuses using the digispark bootloader. An Arduino Uno (or a knockoff) can be programmed to be used as a device programmer for other AVRs. The Arduino ISP includes the software to do this under Examples->ArduinoISP.

You can then put a simple header together to attach to the ATTINY85. I recommend picking up a cheap SOIC8 clip from eBay. The wiring required is described here [1].

Here’s my version of this header:

With the ArduinoISP flashed onto your Uno, it’s now possible to reprogram the ATTINY85. The standard Arduino IDE does not include the board support package to do this however. You need to add the following under Preferences->Additional Board Manager URLs:

With this installed you should be able to select the attiny under Tools->Boards. Also select Arduino as ISP as the programmer. You may need to reflash the bootloader to set the fuses (not sure if this is required or not).

In my case, I also wanted to use an External Oscillator (not external crystal) with the ATTINY85. The damellis package does not include support for this so I had to add it to boards.txt. The location of this file may differ on your system. On my Linux PC it was at:


I was using a 10MHz external oscillator, so I added the following: Osc 10MHz

I also need to wire up the oscillator of course. You can connect it to pin P3 on the digispark header. Of course, the oscillator and digispark will also need power. Here’s my board, all hacked up, and ready to go:


[1] Backup of wiring image from: here.