TLC5940nt, 81 leds and power supply

Hi everybody ! (sorry for my broken english)

I'm working on a project which have to control 81 leds independently. I use TLC5940nt chips, and my minimal test works well (with 1 chip and 9 leds). The arduino program for test is the "basic use" of TLC library. So I tried to test with a power supply (220V to 5V 6A). But it don't work. The leds blinks randomly, sometimes don't blink at all. After some tries, my chip finally burned... I'm bad.

So before making some others dummy things, I come here to have some advices. I make this fritzing schema :

(notes : I use a 4xAA battery in the circuit, but it's a in fact an AC/DC power supply AC: 110/220V +-15% DC: 5V 6A like this one. )

If anyone can help me !

Good evening,

krshk

How about a schematic and some code?

Fritzing is bad in that you can't tell the chip functionality from a black box & wires. A schematic will show you what functionality is connected without having to find a chip's datasheet and then backtracking thru the picture of the wires to see what is connected where.

You need to use decoupling capacitors http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

CrossRoads:
How about a schematic and some code?

Fritzing is bad in that you can’t tell the chip functionality from a black box & wires.
A schematic will show you what functionality is connected without having to find a chip’s datasheet and then backtracking thru the picture of the wires to see what is connected where.

Sorry, I’m a beginner in electronics, and you are right, it is more intuitive with a schematic view :

This one is a version without power supply :

And a basic arduino program, using the TLC library :

/*
    Basic Pin setup:
    ------------                                  ---u----
    ARDUINO   13|-> SCLK (pin 25)           OUT1 |1     28| OUT channel 0
              12|                           OUT2 |2     27|-> GND (VPRG)
              11|-> SIN (pin 26)            OUT3 |3     26|-> SIN (pin 11)
              10|-> BLANK (pin 23)          OUT4 |4     25|-> SCLK (pin 13)
               9|-> XLAT (pin 24)             .  |5     24|-> XLAT (pin 9)
               8|                             .  |6     23|-> BLANK (pin 10)
               7|                             .  |7     22|-> GND
               6|                             .  |8     21|-> VCC (+5V)
               5|                             .  |9     20|-> 2K Resistor -> GND
               4|                             .  |10    19|-> +5V (DCPRG)
               3|-> GSCLK (pin 18)            .  |11    18|-> GSCLK (pin 3)
               2|                             .  |12    17|-> SOUT
               1|                             .  |13    16|-> XERR
               0|                           OUT14|14    15| OUT channel 15
    ------------                                  --------

    -  Put the longer leg (anode) of the LEDs in the +5V and the shorter leg
         (cathode) in OUT(0-15).
    -  +5V from Arduino -> TLC pin 21 and 19     (VCC and DCPRG)
    -  GND from Arduino -> TLC pin 22 and 27     (GND and VPRG)
    -  digital 3        -> TLC pin 18            (GSCLK)
    -  digital 9        -> TLC pin 24            (XLAT)
    -  digital 10       -> TLC pin 23            (BLANK)
    -  digital 11       -> TLC pin 26            (SIN)
    -  digital 13       -> TLC pin 25            (SCLK)
    -  The 2K resistor between TLC pin 20 and GND will let ~20mA through each
       LED.  To be precise, it's I = 39.06 / R (in ohms).  This doesn't depend
       on the LED driving voltage.
    - (Optional): put a pull-up resistor (~10k) between +5V and BLANK so that
                  all the LEDs will turn off when the Arduino is reset.

    If you are daisy-chaining more than one TLC, connect the SOUT of the first
    TLC to the SIN of the next.  All the other pins should just be connected
    together:
        BLANK on Arduino -> BLANK of TLC1 -> BLANK of TLC2 -> ...
        XLAT on Arduino  -> XLAT of TLC1  -> XLAT of TLC2  -> ...
    The one exception is that each TLC needs it's own resistor between pin 20
    and GND.

    This library uses the PWM output ability of digital pins 3, 9, 10, and 11.
    Do not use analogWrite(...) on these pins.

    This sketch does the Knight Rider strobe across a line of LEDs.

    Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 */

#include "Tlc5940.h"

void setup()
{
  /* Call Tlc.init() to setup the tlc.
     You can optionally pass an initial PWM value (0 - 4095) for all channels.*/
  Tlc.init();
}

/* This loop will create a Knight Rider-like effect if you have LEDs plugged
   into all the TLC outputs.  NUM_TLCS is defined in "tlc_config.h" in the
   library folder.  After editing tlc_config.h for your setup, delete the
   Tlc5940.o file to save the changes. */

void loop()
{
  int direction = 1;
  for (int channel = 0; channel < NUM_TLCS * 16; channel += direction) {

    /* Tlc.clear() sets all the grayscale values to zero, but does not send
       them to the TLCs.  To actually send the data, call Tlc.update() */
    Tlc.clear();

    /* Tlc.set(channel (0-15), value (0-4095)) sets the grayscale value for
       one channel (15 is OUT15 on the first TLC, if multiple TLCs are daisy-
       chained, then channel = 16 would be OUT0 of the second TLC, etc.).

       value goes from off (0) to always on (4095).

       Like Tlc.clear(), this function only sets up the data, Tlc.update()
       will send the data. */
    if (channel == 0) {
      direction = 1;
    } else {
      Tlc.set(channel - 1, 1000);
    }
    Tlc.set(channel, 4095);
    if (channel != NUM_TLCS * 16 - 1) {
      Tlc.set(channel + 1, 1000);
    } else {
      direction = -1;
    }

    /* Tlc.update() sends the data to the TLCs.  This is when the LEDs will
       actually change. */
    Tlc.update();

    delay(75);
  }

}

Grumpy_Mike:
You need to use decoupling capacitors
De-coupling

Thanks for your reply, but I’m a true beginner, and I don’t know how to use it. Do you can tell me more about de-coupling capacitors, and how I have to use it in my schema ?

Do you can tell me more about de-coupling capacitors, and how I have to use it in my schema ?

Did you read that link? It tells you all about it.

What's your GSCLK frequency? It may be way too low, possibly effectively disabling the PWM regulation. When the LED brightness is only controlled by the current sources, the power dissipation of the chip is > 4V*16*I_LED, so that a heat sink may be required.

As I understand it, GSCLK should be at least 4096*fUpd. With a maximum of 30MHz I'd think that something > 100kHz will be a good choice.

What’s your GSCLK frequency? It may be way too low, possibly effectively disabling the PWM regulation.

No as the OP is using the

“basic use” of TLC library.

Then all that is taken care of.

He said:-

I use TLC5940nt chips, and my minimal test works well (with 1 chip and 9 leds).
The arduino program for test is the “basic use” of TLC library.
So I tried to test with a power supply (220V to 5V 6A).
But it don’t work. The leds blinks randomly, sometimes don’t blink at all.

So that means the software is correct. If a change in power supply results in erratic operation then the overwhelming odds are that it is a power supply decoupling problem.

the power dissipation of the chip is > 4V16I_LED,

It is not as simple as that. The data sheet shows the dissipation as:-

The device power dissipation needs to be below the power dissipation rate of the device package to ensure correct operation. Equation 2 calculates the power dissipation of device:
PD=(VCCxICC)+(VOUTxIMAX x (DCn / 63) X dPWM X N )

where:
VCC: device supply voltage
ICC: device supply current
VOUT: TLC5940 OUTn voltage when driving LED current
IMAX: LED current adjusted by R(IREF) Resistor
DCn: maximum dot correction value for OUTn
N: number of OUTn driving LED at the same time
dPWM: duty cycle defined by BLANK pin or GS PWM value

Grumpy_Mike: Did you read that link? It tells you all about it.

Hey Grumpy_Mike !

I read the link that you posted, but I am really a beginner in electronic, and this article uses some shortcuts that I do not understand. To top it all, I'm french, so it is a bit harder. So I don't know how to use it and include in my schema, and what is it doing...

If you can explain me where I have to add these de-coupling components, it will be very cool ! Thanks.

If you can explain me where I have to add these de-coupling components,

From the +5 power line to the ground on each chip. Make the leads as short as you can get them.

and this article uses some shortcuts that I do not understand.

I think “shortcuts” is the wrong word here, normally a short cut menas some key combination to bring up a menu item. So can you explain what you mean?

Grumpy_Mike: From the +5 power line to the ground on each chip. Make the leads as short as you can get them.

If I all understand, like this ? And I add a decoupling component for each TLC !

By the way, the decoupling components are, among other components, capacitors ? And if I have to use capacitor, how I choose them ? 1µf ?

Grumpy_Mike: I think "shortcuts" is the wrong word here, normally a short cut menas some key combination to bring up a menu item. So can you explain what you mean?

Sorry, my bad ! It seems to be an 'ellipsis'. In french, when we abstract some notions, because they are common, we use the expression 'faire un raccourci'.

And I add a decoupling component for each TLC !

Yes.

like this ?

No. As I said it needs to be between the Vcc and ground of the chip. In that circuit you have no power going to the Vcc pin and you are connecting the capacitor in series with the power and Vcc not between.

And if I have to use capacitor, how I choose them ? 1µf ?

No 0.1uF ceramic type.

Grumpy_Mike: Yes.

Ok.

Grumpy_Mike: No. As I said it needs to be between the Vcc and ground of the chip. In that circuit you have no power going to the Vcc pin and you are connecting the capacitor in series with the power and Vcc not between.

I hope I do note make mistake this time.

Grumpy_Mike: No 0.1uF ceramic type.

Thank you !

That's better. :)

Grumpy_Mike: That's better. :)

Well. So I tried this morning with capacitor like the schema. And It doesn't work. The leds all bright (normally, the sketch test I use does the Knight Rider strobe across a line of LEDs) and the chip overheats ! Arf !

I think my power supply is not adapted. Some people guide me in a 5V 6A AC/DC power supply, but I don't know if it is the better solution ?

A pic of the power supply, to have an idea of what I'm talking about :

I have to control 81 leds separately. 6A is higher than useful, but it normally doesn't impact the assembly...

Argh, 'm lost.

Any advice Grumpy_Mike, or anyone else ?

and the chip overheats

Then there is something that you not telling about. There is no way that chip will overheat with a 10K current reference resistor and LEDs.

Strip it back to just one chip and test again.

Your chip might not be working, you might have damaged it previously. You might not be using ceramic capacitors. Can you post a clear picture that shows your wiring, not more than 1000 pixels wide.