Daily Archives: 10/23/2011

Using an Arduino as a programmer for the ATtiny13

I’m pretty much near the end of where I wanted to be for the Arduino/Gameduino project: all the major functions that I originally wanted to include are in and working. I’ll be doing a video about it shortly, so I’ve begun to think about what my next project could be. While doing this project, I found an older Arduino NG, and thought it was a shame that I wasn’t using it for something. I also found some old ATtiny13 Atmel chips, and thought those might be pressed into service. Perhaps there was some project I could do that would use both?

Indeed there is.

If you look under the “Examples” menu on your Arduino software, you can find an entry for ArduinoISP. With this, you can turn your Arduino into a programmer that can program other Atmel chips, including really tiny members of the AVR family like the ATtiny13. Why would you want to do that? Well, cost for a start. Arduino clones are cheap, but they aren’t that cheap: you can get the cheapest clones for about $15 or so. But if all you are going to do is flash an LED, or monitor a couple of switches, or read a temperature sensor, that seems like a lot. You can get ATtiny13Vs (nice, they can be powered down to 1.8v) for about $1.91 from digikey in quantity one, and about $1.20 if you buy 25 of them. Cheap! Not quite 555 timer cheap, but pretty close. Anyway…

I thought it might be nice to try to do this. I had some ATtiny13s that I bought a while ago and never did anything with, and an old Arduino NG (previous generation, uses the 168 chips with only 16K of memory). I found this great set of instructions:

Great instructions from Nickolaus, at http://www.local-guru.net

And a few minutes later, had programmed his example “blink” program into my own ATtiny13. Check it out!

So, what can I do with such a thing? I think I am going to try to make a “flickering LED candle” for a halloween pumpkin. I have some of those powerful Cree LEDs, and a little PWM flicker program on one of these chips will make a nice effect. Stay tuned!

Addendum:

Make magazine had a project earlier that showed how you could program slightly more powerful chips (the ATtiny45 and ATtiny85) using the Arduino environment. That’s possible because they have enough space to run shrunk versions of the Arduino libraries.

For the ATtiny13, you need to be even more cagey: you compile with either avr-gcc directly (bypassing the Arduino libraries) or use an assembler like avra.