6 TLC5940 chips daisy chained flashes erratically

I recently took up electronics as a hobby and I'm attempting to create a 5x6 matrix of RGB LED's. I'm using an arduino uno R3 and 6 of the TLC5940 chips daisy chained. I downloaded the TLC library from https://code.google.com/p/tlc5940arduino/ and I'm using their knight rider sketch called BasicUse. I wired the chips up according to this website http://tronixstuff.com/2013/10/21/tutorial-arduino-tlc5940-led-driver-ic/. I looked at the example sketch BasicUse and the wiring diagrams from it and the tutorial I used are the same. I also changed the number of TLC's in the library file to 6. Each column of my matrix is controlled by one chip so there are 5 RGB LED's or 15 inputs out of the max 16 per chip. Each chip does have its own iref 2k resistor (for ~20mA) and i gave each chip the two capacitors shown from the tutorial. The RGB LEDs are common anode with recommended current of 15mA.

My issue is that when i try to run the sketch, the board will randomly blink lights from all over the matrix and after really close inspection i can see that it is doing the sketch but their are so many other lights blinking on and off that its hard to see. I figured out that if i disconnect the gsclck (pin 18 on TLC/pin 3 on arduino). that the sketch works as its supposed to but the lights flash rapidly and the brightness changes and sometimes blanks out. What is causing all the random lights flashing? Is there a clock sync issue? capacitance issue? floating ground? I don't really know how to debug these issues being new to electronics and I do not have access to an oscilloscope to see what the signals are doing. I'm using an old computer power supply for a regulated 5 volts to power the LED's and the chips. and I'm using the regulated 12 volts from the same power supply to power the arduino through the "Vin" port.

If i input the simple code of "Tlc.clear(); Tcl.update" all the lights would go off and stay off. But anything that involves them being on would make them all flash randomly. I took out all the TLC chips except one and tried the sketch and it worked perfectly. no strange flashing or flickering. When i tried two chips, it would still work great except I would see a very brief, dim flash from all the LED's connected to one chip. and both chips would do this flash at random intervals. I couldn't see a pattern to the flashes. When i plugged in 3 chips it would do the random bright flashing. I even tried bypassing to another column of lights to see if it my soldering for those set of lights was bad but it still did the same thing and i tried different chips. On my breadboard I only had space for 2 chips so i hooked them up to see if i had hardware or software issues and the chips and lights worked perfectly. No flashes or any erratic behavior. Today i unhooked the gsclck and the pattern wouldn't work like it originally did but if i grabbed the insulation of the gsclck wire then it would work. Any ideas on my problem(s)?

Have you got any decoupling on your chips? http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Bread board is not very good for big circuits like this. You want everything soldered down.

Grumpy_Mike: Have you got any decoupling on your chips? http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Bread board is not very good for big circuits like this. You want everything soldered down.

forgive my ignorance but i thought the capacitors from the tutorial i posted were the decoupling capacitors. Or does the chip need another capacitor across its positive and negative pins? Also everything is soldered together and not on a breadboard. I was just trying to debug using a breadboard with 2 chips to see if it was a software or hardware issue. and the breadboard with 2 chips worked perfect.

forgive my ignorance but i thought the capacitors from the tutorial i posted were the decoupling capacitors.

Sorry you are right it does. Only when I loaded the page the schematic was just a long thin streak that showed no detail. I had to left click it and select view image. Then it would load from the page next time. So you have two capacitors on each chip.

Have you used a ceramic capacitor for the 0.1uF other types are not very good for that job?

Getting 6 chips to work can get problematic. Is your power supply up to it? I would also up some of the 4u7 caps to bigger values especially at the end of the chain. The capacitors should have a short a lead as possible and be sited as close to each chip as possible.

It does sound like a stability issue rather than a software issue. You can try a star power and ground wiring, that is where the +5V and ground to each chip are wired to one point each, rather than being chained one to the other.

my power supply is an old desktop computer power supply that I converted into a “lab” power supply. I’ve attached a picture of it. The label on it says it can supply 12 amps at 5 volts so I know it can handle the load. The board i bought was small so i had to solder on both sides of the board to fit everything. I’ve thoroughly checked and so has my dad and there are no shorts anywhere that can be found. I’m also attaching a picture of the top of the device. The picture isn’t the finished product but you can see the location of the chips and the capacitors. In the center i have an amplification circuit and the blue capacitors as well as the black one on the right of the solo 8 pin socket go to it and with the op amp not in place they aren’t connected to the circuit so no effect. My end goal is to make this a music visualizer so i needed an amp but you can ignore it.

You mentioned a star pattern for power and I sorta have that. Each of the two chips that are next to each other are jumped from one to the other and then they connect to a point somewhere around the bottom center so the “star” would have 3 legs with 2 chips per leg. The LEDS are also jumped from that point near the bottom in the star pattern in the same fashion. I looked at the diagram again and the capacitors are not jumped from the pos/neg for the chip but from the positive for the LED’s to ground so would it still act as decoupling caps even though its on different legs of the “star” and not on the leg the chip is powered on? I would attempt to solder 6 more caps in directly across the chips pos/neg since they are pins 21 and 22 but I don’t really have room. The board is approximately 4x6 inches to give you an idea of size.

oh and the 0.1 uF are ceramic and the other is electrolytic

UPDATE. I found that 2 chips will work perfectly no matter what socket they are placed in. No flashing, jittering, or anything and they follow the sketch exactly. But its the third chip that makes it go crazy every time independent of location. So the question now is why does the third daisy-chained chip create these issues? The chips are functioning, I've tested each one individually.

So I assumed that since the arduino and the lights were going to the same power supply that the grounds were connected but i connected one from the arduino to the breadboard where i was giving the matrix power and that fixed it. Makes me happy to know my first major solder project works great and it was just a missing ground connection causing issues. Thanks for your help though.

Glad you got it going.

In a way it was a decoupling issue because your round about way of getting a ground was ruining the star configuration off your wiring. This why it worked for two chips but not for more as the currents increased your " ground bounce" increased.