10x10x10 RGB LED Cube

A couple years back, I built an 8x8x8 cube with blue LED's following a guide on instructables that everyone here is probably familiar with. I recently decided that I wanted to make an RGB LED cube, and I noticed that Arduino had a TLC5940 library. I had a Teensy ++ 2.0 lying around from another project (http://www.pjrc.com/teensy/index.html), and I noticed that it's compatible with Arduino (http://www.pjrc.com/teensy/teensyduino.html). I purchased 1500 common annode RGB LED's and 20 TLC5940's. I got my TLC5940's in the mail today, and I tried a simple test, and it looks like I've encountered a pretty serious problem.

void loop()
{
  int i = 0;
  while(1){
    //Tlc.clear();
    if(i == 1){
      Tlc.set(1, 4095);
      Tlc.set(2, 4095);
      Tlc.set(3, 4095);
      Tlc.set(4, 4095);
      Tlc.set(5, 4095);
      Tlc.set(6, 4095);
      Tlc.set(7, 4095);
      Tlc.set(8, 4095);
      Tlc.set(9, 4095);
      Tlc.set(10, 4095);
      Tlc.set(11, 4095);
      Tlc.set(12, 4095);
      Tlc.set(13, 4095);
      Tlc.set(14, 4095);
      Tlc.set(15, 4095);
       i = 0;
    }else{
      Tlc.set(1, 0);
      Tlc.set(2, 0);
      Tlc.set(3, 0);
      Tlc.set(4, 0);
      Tlc.set(5, 0);
      Tlc.set(6, 0);
      Tlc.set(7, 0);
      Tlc.set(8, 0);
      Tlc.set(9, 0);
      Tlc.set(10, 0);
      Tlc.set(11, 0);
      Tlc.set(12, 0);
      Tlc.set(13, 0);
      Tlc.set(14, 0);
      Tlc.set(15, 0);
      i=1;
    }
    Tlc.update();
    //delay(300);
  }
}

With the delay commented out completely, there is still noticeable flickering in the LED's. What is causing this? Are the TLC5940's too slow to work in this application? The Teensy++2.0 runs at 16MHz, so I doubt that is what's causing the slowdown. Has anyone successfully made an LED Cube using the TLC5940's? Is an extensive rework of the standard library needed to get this working properly?

I'm willing to switch to shift registers or something more basic if that's a better approach. Are there shift registers that would be fast enough and provide variable outputs to the LED's? Some guidance would be greatly appreciated. Thanks.

10x10x10x3 = 3000 LEDs. You'll need 188 TLC5940's to drive them. To load those you need 12 bits * 3000 LEDs or 36,000 bits. At 8 million bits per second (SPI's highest speed, I think) you'd be able to update the entire cube over 220 times per second. I don't think you will have a hardware limitation, at least as far as pushing bits through SPI.

Does the library you are using use the SPI pins and SPI hardware or does it do the shifting in software?

An alternative would be to use 38 shift registers to drive the 300 columns and two more to drive the 10 planes. 40*8 = 320 bits per plane per update. For all 10 planes that's 3,200 bits. At 8 Mbps that's 2500 updates per second. At 32 levels of brightness that's about 78 updates per second.

johnwasser: 10x10x10x3 = 3000 LEDs. You'll need 188 TLC5940's to drive them. To load those you need 12 bits * 3000 LEDs or 36,000 bits. At 8 million bits per second (SPI's highest speed, I think) you'd be able to update the entire cube over 220 times per second. I don't think you will have a hardware limitation, at least as far as pushing bits through SPI.

Does the library you are using use the SPI pins and SPI hardware or does it do the shifting in software?

An alternative would be to use 38 shift registers to drive the 300 columns and two more to drive the 10 planes. 40*8 = 320 bits per plane per update. For all 10 planes that's 3,200 bits. At 8 Mbps that's 2500 updates per second. At 32 levels of brightness that's about 78 updates per second.

Hmm...I think your calculation is a little off. To control the cube I need to control each of the layers (10x10x3 = 300 pins) plus the layer select (10, 1 for each layer). To animate something on the cube, I need to be able to update 300 pins and select a layer repeatedly 10 times over and over, quickly enough to acheive perstistence of vision so the LED's don't look like they're flickering. Every time I select a layer I have to re-update the 300 pins.

Also, I'm using the standard arduino tlc5940 library.