Most of us are aware that charlieplexing can drive a large number of LEDs from a relatively small number of I/O pins, but [David Johnson-Davies] demonstrates adding another dimension to that method to create individually controlled PWM outputs as well. His ATtiny85 has twelve LEDs, each with individually-set brightness levels, and uses only four of the five I/O pins on the device.
Each LED can be assigned a brightness between 0 (fully off) and 63 (fully on). The PWM is done by using one of the timers in the ATtiny85 to generate a periodic interrupt, and the ISR for the interrupt takes care of setting the necessary ratios of on and off times for each charlieplexed output. The result? Twelve flicker-free LEDs with individually addressable brightness levels, using an 8-pin microcontroller and just a few passive components on a tiny breadboard. There’s even one I/O pin left on the ATtiny85, for accepting commands or reading a sensor.
[David] really wrings a lot out of the ATtiny series of microcontrollers with his compact projects, like his Tiny Function Generator (which recently got an update.) He also demonstrated that while charlieplexing is usually used with LEDs, charlieplexing can be used with switches just as easily.
Wow! Increible! I love attiny85! It could bé used to create a simple clock. Using the free I/O with an external Real Time module. I will try it.
That’s a good idea, you could have the hour hand set to full brightness and the minute hand to dimmer value.
I wonder if you can get many more with daisy-chained ws2812s or shift registers? Not trolling, I genuinely don’t know.
Not trolling? Then short answer “yes”. With enough shift registers, and enough time to fill them / slow enough update rates, you can light up the world with only two pins.
Not trolling. I thought shift registers are super fast?
Similar to this? Using an ATtiny13A instead: https://www.youtube.com/watch?v=8I2yQX_0R4g
Remarkably similar!
and
https://hackaday.io/project/162791-celtic-christmas
and
https://hackaday.io/project/162721-tiny-snowflake