ATtiny13 Programmer Gets a Clock Source

Once you set the fuse bits on an ATtiny13 such that it expects an external clock then you must provide one during SPI programming. After one foolish attempt that locked a device in an unprogrammable (via SPI at least) state, I decided to add a clock source to the programmer properly.

It is a simple 10 MHz pierce oscillator, implemented using one transistor. It runs from the 5 V regulated rail and injects its collector signal into the CLKI pin. Internally clocked MCUs will ignore this, and drive contention should not be a problem for MCUs activated in the programmer.

Front of Modified Programmer
Back of Modified Programmer

I think you can probably work out the topology from the pictures, but the collector load is 2k7, the bias resistor 560k, the xtal goes collector to base, and the base is taken to ground through 33p.


It would be nice if avrdude supported supplying a clock via the parallel interface. It already has a config file where you can specify the pin mappings, a slow clock would be great for people that want a "just wires" programmer that can program when the clock source has been programmed external. I haven't looked at the avrdude source, but I guess I could add this feature myself...

AVR dude also doesn't support the HV protocols, there are enough pins on the parallel port to easily implement a HVS programmer - I did it to unbrick the MCU mentioned above. Heck I implemented a HVP programmer though the parallel port once.

Its a shame this "legacy" port isn't available on most modern laptops! External USB devices just aren't the same, but you can use a cheap serial dongle to clock some bits into one or more 74HC595s for as many output bits as you want. Input bits are bit more tricky but do-able.


Parent article: ATtiny13 Programmer.