Any tips on troubleshooting a chain of TLC5940's?

Hi All,

I have started to put together a chain of 7 TLC5940's on a breadboard, with 16 white 5mm round led's per TLC5940. I have set it up according to the page (hardware setup section) on the playground: Arduino Playground - TLC5940

Then I loaded an example sketch from the library to see if I could test it, using the fading knight-rider effect.

The problem I run into however is that the first 5 in the chain work find, the sixth is not nearly as bright as the previous ones and the seventh one does not show anything at all, apart from some erratic flickering. The LEDs connected to TLC's 6 and 7 sometimes dimly flicker too.

I have checked and rechecked the wiring, the resistor, etc, but can't find if anything is wrong.

I wonder what's going wrong, but I am not sure how to troubleshoot the setup? Or that I should be doing more math, maybe too little power (although not more then 5 led's are on at any given time).

Anyone got tips for me on how to debug this?

Kind regards,
Arno

From the top of my head, and without paying too much attention to the "mickey mouse" schematics you posted because it really doesn't say much I'd look at two things:

  • Is the power supply enough for what you are doing? When you try to light up the 6th and 7th, what happens to the others?
  • Check that the I2C signals get through. You might need to create a pull-up on the Sclk and Sin pins of the 6th and 7th chips. Try that. Put a 4k7 or 10k resistor between the pin and 5V and see if it works.

Ah, thanks for the input. I will give that a try. You mentioned the "mickey mouse" schematics. Do you mean the ones posted on the playground page? I have tried to capture a schematic in Eagle for the first time, with this result, but I doubt it is really helpful in this case, since it only shows the way a TLC can be chained and connected to the LED's; it does not (yet) include connections to the Arduino.

But just in case it might be helpful:

You need to add decoupling capacitors on each chip:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Don't chain the power and ground but have a wire directly to the supply for each IC.

Don't have them too far apart.

Thanks for those tips Mike. You don't seem too Grumpy to be honest :wink:

Great tutorial, thanks for that! I need to brush off my math skills a bit, but the explanation make it very clear why the power supply to the IC's is probably not very smooth and will be even worse the further you go down the chain.

Unfortunately I do not have 7 capacitors laying around with equal values, but I had 3x 10uF and 4x 100uF so I tried that to see what effect it would have and though the behaviour was even more erratic (as expected), the LED's on TLC's 6 and 7 do light up as bright as the rest, so it looks like adding the de-coupling capacitors saves my bacon.

Thanks again, to be continued...

Yay, it works! And better yet, I know why!

I told a friend about what I was doing, and he told me that the 7 capacitors should not necessarily have to be all of equal value. I went back to re-examine the setup on the breadboard and figured out why it didn't work as expected; I had placed a few of the capacitors in series with the +5V and Vcc on the TLC, instead of paralel to the +5V and GND. Once I changed that, it worked beautifully!

And indeed if I get the power from (physically) closer to the source, it slightly affects brightness of the led's.

Thanks a lot for the help gentlemen!

Hey Aetjansen,

I've been struggling with the same problem as you are (were). I'm wiring 10 TLC's, and with me they also start giving me problems when more than 5 are connected, so I'm really glad i found this post. Sadly my electronic skills are quite bad, so I'm having some problems with translating the de-coupling tutorial into what i should do. Could you tell me between which pins (of the TLC's) exactly you connected the capacitors?

Thanks in advance.

Follow the GND and VCC wires to the chip (on the schematic or the real circuit) and put the decoupling caps between those two wires near the chip. The rule is that any chip handling logic signals or loads switched from logic signals need decoupling capacitors. LED drivers handle high currents switched at high speed and need LOTS of decoupling. Ideally something like 220nF ceramic + 10uF ceramic/electrolytic next to each chip. Each cluster of chips (especially if remote from the power supply) should have something like 220uF - 1,000uF electrolytic as well to help keep the supply clean and reduce radio-frequency interference.

It can be an education to hold an AM radio near your digital circuit and scan the band!

Thanks for the fast reply. Sadly thou I already had 100nF capacitors over my VCC and GND. I could try to upgrade them to 220 nF, would that work?

Ten is a lot as the clock signal is a very high frequency and that gets lost in the capacitance of the wiring. You could try a 2K or so resistor from the clock signal at the last chip in the chain up to 5V.

I've tried the resistor to no avail :frowning: I've also measured through my clock signal with an oscilloscope. The strange thing is that when i attach more tlc's to the chain the signal at the arduino decreases in amplitude. However how farther down the chain i measure how larger the amplitude becomes (which i think is strange). Effect is that how more i connect how more work. with 6, 5 will work, but with 12, 8 or 9 will work.... I tried to explain this by the erratic amplitude of the clock, so i bend everything around and also fed the clock, the blank and the xlat into the and of the chain, but still to no success. I've also tried to buffer the signal, and i've tried to delay the signal with 100ns, both no luck

For now I gave up and chose to work with two arduino's instead, which requires some programming. But I'm still very annoyed that i didn't solve the problem. TLC's are made for daisy chaining so you would expect that there are ways to link a great many. Are there any example of projects where say 10+ Tlc's were connected in one daisy chain, and if so how was it done?

A last remark I thought of yesterday. The library uses pin 13 for the clock signal, can it be that the led and resistor on this pin have an influence, or even create the amplitude change mentioned earlier.

I've also tried to buffer the signal,

With what? Ultimately this is the answer. A buffer at the drive end and one at each of the receivers would be best.

TLC's are made for daisy chaining so you would expect that there are ways to link a great many

There are but not at the distances you ate expecting them to go at.

The library uses pin 13 for the clock signal,

That is because of the hardware inside the processor attached to that pin.

can it be that the led and resistor on this pin have an influence,

They will not help as they will take some of the drive capacity away. You could try removing the resistor.

However how farther down the chain i measure how larger the amplitude becomes (which i think is strange).

Yes strange but not un understandable. You are measuring at various points in a distributed network of LCR (inductors capacitors and resistors) and the inductance effect will sometimes show this.

with 6, 5 will work, but with 12, 8 or 9 will work.

That sounds like a transmission line effect, where signals are reflecting off the impedance discontinuities at the end of the line. The answer to that is to match the impedance of the line with the correct size terminating resistor.

There is a nice animation of that here:-