Using 10 of TLC5940 in control

Currently I am working on controlling 11*13 LED grids (PWM).

I got 10 TLC5940 and testing it on my breadboards using TLC5940 library ver004 developed by Alex Leone (I downloaded it at the playground about the chip).

Therefore the pin setup is (as described in the example source file of the lib)

  • Pin setup:
  • ------------ ---u----
  • ARDUINO 13| LED2 |1 28| LED 1
  • 12| LED3 |2 27|-> GND
  • 11| LED4 |3 26|-> SIN (pin 4)
  • 10|-> BLANK (pin 23) LED5 |4 25|-> SCLK (pin 6)
  • 9|-> XLAT (pin 24) . |5 24|-> XLAT (pin 9)
  • 8| . |6 23|-> BLANK (pin 10)
  • 7| . |7 22|-> GND
  • 6|-> SCLK (pin 25) . |8 21|-> VCC (+5V)
  • 5| . |9 20|-> 2K Resistor -> GND
  • 4|-> SIN (pin 26) . |10 19|-> +5V
  • 3|-> GSCLK (pin 18) . |11 18|-> GSCLK (pin 3)
  • 2| . |12 17|
  • 1| . |13 16|
  • 0| LED15|14 15| LED channel 16

(sorry for the messy formatting)
Actually this pin setting is for a single TLC5940, but I need to daisy-chain it almost 10 times.

So I referred setup at (http://pixelriot.com/pmatp/node/273)

I've reordered pins in the source code correctly, but not sure about whether VPRG(27) and DCPRG pins should be connected to arduino or not. Those pins are connected to arduino it pixelriot.com's wiring, while connected to GND and +5v in the library.

In short, I followed the wiring of pixelriot.com except VPRG and DCPRG pins and used sample code of TLC5940Library. The result is... it works with only the first TLC5940. If I tried to use more than one chip in the source code, LEDs blink so fast and seem to crash in a few minutes.

Is there any stable resource that I can refer to use many TLC5940 chips for controlling LEDs?

I found another library from whatever.metalab.at. (below)

The sample code works fine with 3 TLC5940s, but there still is a problem. In the sample code below, leds.setLED(pinNumber,Intensity) function doesn't seem work properly when Intensity's set to below 250. (250 works OK until it loops around 50 times, while 255 runs forever without any problem). If it's set below 250, arduino re-run setup() frequently (and irregularly). As the intensity accepts 8 bit number, should I be able to put any integer or byte?

/*
  The TLC5940 library must be installed first:
  Copy (or symlink) the TLC5940 folder to <Arduino-dir>/hardware/libraries/
*/

#include <TLC5940.h>

// Parameter 1 is number of tlc5940 chips in series, 
// parameter 2 is number of grayscale bits per led.
TLC5940 leds(3, 8);

void setup()
{
  Serial.begin(115200);
  
  // FIXME: Pin allocation should be configures here
  leds.init();
  leds.clear(); // Clear framebuffer
  leds.display(); // Display framebuffer
  Serial.println("TLC5940 tester");
}

byte ledcounter = 0;
int intcounter = 0;

// Some super-simple test animation
void loop()
{
  leds.clear();

  for (byte i=0;i<48;i++) {
      leds.setLED(i, 249);
      leds.display();
      delay(50);        
  }
}

To use multiple TLCs in series, hook SOUT (pin 17) of the first TLC to the SIN (pin 26) of the next TLC, and so on. Try downloading the latest library (TLC5940LEDv006.zip at this point). Then run the examples, but change the #define NUM_TLCS at the top to however many TLC's you have daisy chained.