Does anyone know of a way to slow down a Bus Pirate's programming speed to or below 4kHz, so that it'll allow me to program an Attiny45 clocked with an external 32.768kHz crystal? Preferably one that doesn't involve a massive amount of coding in either avrdude or the Bus Pirate's firmware ;)
The slowest possible SPI speed of 30kHz is way too fast for this configuration and results in the dreaded "initialization failed, rc=-2" error, but luckily with a known cause this time. I've also tried an avrdude patch I ran across that implements avr programming through the raw wire protocol (avrdude patch #7723), but this bottoms out at 5kHz and still results in failures. Since I've only got a BPv4, the stk500 firmware also doesn't seem to be an option.
Right now I have to make do with a bsd parport programmer as a workaround (with -B 250 -i 1000), but this is a big hindrance in my development process (requires unplugging, walking to a different room, etc). I'd rather use my favorite little tool.
Ok, scratch that question. I worked around the problem by purchasing a "real" avr programmer, because it was one of those "needs to be done by yesterday" projects. But with this out of the way, I'd still like to have a BP capable of programming at variable speeds instead of set SPI rates. Which sounds like a perfectly good excuse to attempt adding an stk500 mode to the BPv4, which I'll try next ;)
I think the AVRDude mode uses hardware SPI and the low speed is limitation of the hardware. It could go slower with a [patch to support software SPI too, but It wouldn't be totally easy because hardware SPI mode had extended support for the programming app.