Tuesday, March 4, 2014

16 RGB LEDs running on an ATTiny84

As an experiment, I wanted to get 16 RGB LEDs running off a relatively small microcontroller.  I got it going with an ATTiny84 using 8 I/O pins (leaving the ISP pins alone).

I had to boost the CPU speed from 1 to 4 MHz (it will run up to 8 MHz on the internal oscillator depending on how the prescaler is set).  I'm not sure if I'm going to wind up using this or not.  It is extremely cheap to build a flashy device with this method but the chip only has 8K of flash and I've used up 6.5K with the color rotation code and the display routine.  I think half of that is the color rotation, it's using some math libs, so probably I could trim that down.

The alternative is to use WS2812Bs which are super sweet but not cheap - they would about double the price of the device, and if I'm going to do that, I will probably go ahead and spend the extra dollar or so, use an ATMega328 and make it Arduino compatible.

No comments: