Introduction: Using the 8Pin ATTINY Programming Shield With an External Clock
Instructables author extraordinaire Randofo created a great programming shield to use your Arduino to program 8 pin ATTINY processors. He was even generous enough to give 50 copies of it out to people who authored instructables using AVR processors.
It works great on brand new ATTINYs and any chip that is programmed to use it's Internal clock. There's one small problem. If you are using an external clock source such as a crystal or ceramic resonator, the chip will not be reachable as it is expecting something to keep it's heart beating from outside.
In this instructable I'll show you how to talk to attinys using an external clock source.
Step 1: Fuses and Connecting an External Clock Source
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:
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.avrdude: Device signature = 0xfff000
avrdude: Expected signature for ATtiny85 is 1E 93 0B
Double check chip, or use -F to override this check.
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.
Step 2: Command Lines for Burning the Fuses.
Randofo's example uses the Arduino software to program.
Here's an example of using avrdude command line for burning the tv-b-gone code.
avrdude -p attiny85 -P com18 -c arduino -b 19200 -B 1 -U flash:w:tvbgone.hex
And to burn the fuses:
avrdude -p attiny85 -P com18 -c arduino -b 19200 -B 250 -u -U lfuse:w:0xfd:m -U hfuse:w:0xdf:m
replacing com18 with whatever port yours shows up as.