It appears that the reading of the datasheet whereby TLC5940 can sink only 120mA/chip is incorrect:
Rather, it seems that the correct reading of the "\$I_O\$ Output Current (dc)" value on page 2 of the datasheet is as maximum current per channel, which is also the interpretation arrived at by Sparkfun discussion to this driver. The ambiguity of the phrasing Output Current (dc) is resolved in favor of per channel reading owing to:
- The fact that these drivers employ current mirrors, which given sufficient (voltage) headroom (see figure 5 of the datasheet), no more than that, do not use very much power.
simulate this circuit – Schematic created using CircuitLab
To clarify the above point: In the schematic above, the voltage that the TLC5940 sees, i.e. LED Vcc (or \$Vcc_{LED}\$ but be above certain threshold, cal that threshold \$V_{HEADROOM/TLC5940}\$, which is around 1.25V for \$I_{output}\$ 120mA, and is .35V or so for \$I_{output}\$ 20mA. Any voltage at \$V_{OUT/TLC5940}\$ over \$V_{HEADROOM/TLC5940}\$ must be dissipated by the device as heat. For maximum possible current in the TLC5940, you would want to match \$Vcc_{LED}\$ to \$V_{forward}\$ of that LED, so that the TLC5940 IC dissipates the minimum power necessary, since power dissipation rating is a limiting factor on how much current the device can sink at each channel.
(and back to the list)
- The fact that in recommended operating conditions the maximum current refers explicitly to channels:
- According to the power dissipation calculation, assuming \$d_{PWM}\$ of 100%, VCC=5.0V, supply current of 60mA, \$V_{OUT}\$ of 1.0V (test conditions), dot correction of 1, we arrive at 5.0V*0.06A + 1.0V * 0.06A * 1 * 1 * 16channels we get 1.26W of device power dissipation. The PDIP package is rated for at least 2.5W at 25 deg C.
Your reply to Andy's question implies you want to control every LED separately. You have started down the path of using a matrix to control the LEDs, which would allow you to turn any one LED on, and many combinations, but not completely independent control of all LEDs.
So, one direction to go is completely independent drivers, one per LED. This will be simplest to program from your computer. However you will need a way to output 512 separate wires worth of values from your PC or microcontroller. An economical way to do this would be to use a few I/O pins to send data to 8-bit shift registers (in one long series, or in several shorter series) which may have the ability to sink enough current output to drive your LEDs directly (with resistor in series with each, of course). 74HC597, 74HCT597 and 74HC299, 74HCT299 are possibilities. If you need more current per LED, then you could still use shift registers, and add 8-wide transistor packages, like LUN2803A as drivers.
That said, you can create the visual effect of independently controlled LEDs, using a matrix. Your program select in turn each "row" of LEDs, briefly pulses them in the desired pattern, then moves on to the next set, and so on, until your program has covered all the LEDs.. then start over. (aka multiplexing)
For 8x8x8 LEDs (512), you would need a minimum of 22 x 24 matrix (eg: 22 rows x 24 columns = 46 pins), though 16 x 32 = 512 (48 pins) would be more congruent with your cube, so easier to program. Your program would need to continuously cycle through all 16 rows, setting the 32 columns for that row (or vice versa), "refreshing" them say 50 times a second to create the impression of constant illumination and fluid motion. That's 50 x 16 = 800 rows/sec.
Bear in mind that since each 'on' LED is only on for a fraction of full-time (say 1/16th), it will appear dimmer than when full-time, so you may the need to increase the current to compensate.
There are a number of similar projects on YouTube, you can probably find one with a similar number of LEDs, from which you can gauge the tradeoffs between brightness, smoothness, and CPU speed needed to keep refreshing and add animation.
OK, hope that helps.
Best Answer
Yes, you can do a POV application with your ATmega16L and a bunch of LEDs and resistors and some clever programming.
The simplest POV application I've seen and that I have incidentally built is an Arduino shield called Blinkenlight.
This particular board has a set of 20 inline LEDs that you can program to display the POV effect. You can then achieve the POV effect by waving it around in the dark. So, it's mechanical and human powered (yes, your arm will get tired after playing with it for a while).
It's based on Arduino Uno and related boards, but you can easily build your own standalone version and even modify it to use your ATmega16L.
Here's a few pictures of the POV effect in action:
The idea behind the circuit is quite simple, you just have to wire a LED and its corresponding series current limiting resistor to every digital output pins you have available (as in the schematic below). The rest is programming.
The board can do a few other tricks as well, such as The Night Rider effect and more.