Cube follow up

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:

Questions

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.

 

Atmel AVR ISP mkII

Atmel AVR ISP mkII

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.

Advertisements
This entry was posted in ATTiny45, AVR, Electronics and tagged , , , , , , . Bookmark the permalink.

8 Responses to Cube follow up

  1. MMM says:

    Thanks for the nice overview! 🙂

    It’s great how much this little microcontroller can do: builtin flash, I/O, timers and software USB. If I find someone who has the programmer to flash the firmware I would start now… going to check with my friends. Just for playing around with it on my freetime the Atmel programmer costs a bit too much, it’s about €50 (£45) in Europe. If someone knows an alternative (USB or serial) please post it.

    Btw, link with more information for beginners:
    http://imakeprojects.com/Projects/avr-tutorial/

  2. Dennis says:

    conrad sells a cheap USB atmel prrogrammer (28 euro) that works with avrstudio and avrdude and can also write attiny45.

    You could always build your own of course, serial port programmers are really simple things to build.

  3. teenytiny says:

    Beware, using brighter LEDs without a transistor-based amplifier can damage the ports of attiny!

  4. teenytiny says:

    btw, has anyone tried attaching a servo instead of one of the leds?

  5. Mike Burrows says:

    If an ultra-bright LED will burn an IO pin, wouldn’t a servo also need an op-amp or a transistor?

    • davehillier says:

      A servo has three wires, +ve, gnd and control.
      The control goes into a transistor inside the servo, so doesnt require much current.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s