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.
Fuses and connecting an external clock source
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!
For more Detail: Using the 8Pin ATTINY programming shield with an external clock
Leave a Comment
You must be logged in to post a comment.