I’ve been asked a few more questions about the Cube, so here is a follow up post with some answers.
Here are the previous posts with the information so far:
What toolchain did you use?
I use Crosspack tool chain (formerly AVR MacPack)
I also use V-USB (formerly AVR-USB) by the same author as Crosspack. This is a software USB implementation that works great in this scenario when only a small amount of information needs to be transferred.
How do you flash the chip?
I’ve created a small board powered by USB which I can insert the ATTiny into and attach an Atmel ISP mkII. Flashing the program is as simple as typing ‘make program’ from the firmware directory in the code.
How much did the components cost?
- ATTiny45 £1.26
- USB Connector £0.29
- LEDs approx £0.60
- Resistors, Diodes, strip board approx £0.60
The cube itself was a freebie and I could have salvaged the LEDs. I’ve deliberately aimed to keep things simple with as few components as possible. It has cost less than £3 (~$5).
Is it fast enough to do colour fading?
Yes. It uses software PWM to create 24-bit colours. That means the LEDs are turning on and off really quickly to give the impression that they’re either bright or dim and mix in different proportions to create all the shades.
At the moment I just run the executable (in the commandline directory in the code) many times to create the fade. It wouldn’t be too complicated to extend the firmware to add smooth fading or alternatively to the command line tool.
How fast can you change the colours?
Pretty much instantly. However, it depends what you mean by ‘change’. As I mentioned before the LEDs are turning on and off constantly. You are limited by the transfer rate of the USB, but you could add colour fading in the firmware reducing he number of instructions required to change.
Can I see more pictures?
I probably won’t revisit this project, but I promise to add more to future posts.
My cube is a bit dim how can I make it brighter?
It depends, I have build one board where I have removed the resistors protecting the LEDs as they are rated at approximately 3v. It is also possible to run LEDs at a higher voltage than their max rating if you reduce the duty cycle as described in this article.