Instructables

Using the 8Pin ATTINY programming shield with an external clock

Featured

Step 1: Fuses and connecting an external clock source

Picture of Fuses and connecting an external clock source
resonator.jpg
IMAG0046.jpg
AVR microcontrollers have two configuration bytes in their internal memory that control various aspects of how the processor is initially configured and run. These are called FUSE bits for obscure reasons, and if you get them wrong, you can render the processor inoperable (or bricked!) These can be reset with a special high voltage programmer. One Fuse bit, the clock source, is initially set to use the chip's internal oscillator. For many applications, this is fine, but if critical timing is necessary it's necessary to use an external crystal or oscillator. These are much more temperature stable and precise.

The 8 pin programming shield doesn't use an external oscillator. You can program the rest of the flash of an ATTINY with the programming shield as long as it's Clock fuse is set to internal. You can even write the Fuse bits if you don't change the clock, and you can even write that ONCE! After that, if you don't have whatever kind of clock you've selected available, the chip just won't function, even for programming.

For example, I have a hack for the TV-B-Gone that turns it into a Super Camera Remote. The TV-B-Gone uses an external 3 pin ceramic resonator like the one pictured here. If you take the processor that comes with the TV-B-Gone, or program the fuses using the makefile in the open source firmware package, you'll get  this error:
avrdude: Device signature = 0xfff000
avrdude: Expected signature for ATtiny85 is 1E 93 0B
Double check chip, or use -F to override this check.
Fortunately, Randofo  includes female headers as a breakout of all the pins. Get one of these 3 pin resonators and connect the middle pin to Ground (pin 4) and the other two to pins 2 and 3.

If you do this, you can reprogram, including going back to internal clock!

Here, I used a breadboard, but it would also be easy to take a little strip of protoboard and make a little header to plug right in.