Tlc5940s go crazy when addressing more than about 6 channels.

Hi folks, I've daisy chained two Tlc5940s for a mood lamp project of mine; hoping to involve it in a home automation project. But they are acting in a very peculiar way!

It seems if I have any more than 6-8 channels out of the 32 available set to non-zero then all the lights flash in a horrific, vomit inducing fashion. For example, these work fine:

-Fade each channel all the way up, and then all the way down in turn.
-Take six channels next to each other (or separated, although I haven't tested this yet), and fade them all up.

Because of this behaviour, I struggle to think that it's the hardware that is at fault, unless the more the channels addressed the greater the data sent and there is suddenly some kind of interference...? I can control each channel perfectly, just not all together.

I'm pretty sure that my code is ok, but I think I may have not sorted out the config.h file properly, all I've done is change NUM_TLCS to 2 instead of 1. The reason I'm pretty sure my code is ok is because if I set Tlc.init(0), I can address channels on there own, as long as no more than around 6 are non-zero. But if I set Tlc.init(1-4095) everything goes crazy!

Also, I tested each Tlc5940 on its own and they worked great, I could address all channels together with no crazy lights. It's only now they are chained together it doesn't seem to work.

I currently have a capacitor between ground and +5v.

I'm driving the led's of a 12v supply (it's a RGB strip light).

So, either the Tlc5940 library is wrong (which it seems pretty clear it isn't!), my wiring is wrong (which doesn't seem to make sense, as I can control each channel on its own fine), my Tlc5940s are bad (again...unlikely seeing as I tested them separately)...oorrrrrrr there is some interference I'm missing?! There is a good meters worth of wire between the end Tlc5940 and the Arduino?

That, or I'm missing something in the Tlc5940 library?

I hope I've been clear! I know it's best to try and give the most information possible. :slight_smile: I'd really appreciate any help you guys can give me as it's really bugging me! Would be nice if I was missing something really obvious. :stuck_out_tongue:

Deeksie

Is itthe power supply? work out the total currant with all led's on and anything else. Is it more than the power supply?

Good suggestion!

I measured the current drawn by one rgb strip at max power...around 160mA. x10 that's 1.6A, and I'm using a 12v 2A power supply. Should be ok right?

To clarify when the lights go crazy, all the channels seem to randomly strobe at maximum power. Not just the ones that are set to be on...

Thanks!
Deeksie

Just tried it with a converted ATX power supply, capable of 15Amps on the 12V rail...same behaviour as before. Figured there was a chance my transformer was over-rated since I got it from eBay.

I'm stumped...

I currently have a capacitor between ground and +5v.

Just the one? Each chip should have its own 0.1uF capacitor as close to the chip as possible. And it should be a ceramic one.

Good call Grumpy Mike, I didn't realise that the proximity of the capacitor to the chip mattered. Will have to order some capacitors as I don't have any handy at the moment. I'll report back when I've modified it. :slight_smile:

Thanks guys!

Deeksie

Hi guys, just got the capacitors and put one 100nF (0.1 uF yes?) between ground and 5v for each Tlc5940, right next to the chip...actually attached to the pins.

Same problem as before, hasn't fixed it. :-/ Thanks for trying so far though. :slight_smile:

Deeksie

It could be your layout can you post a photo?

Hey guys,
Here's a link to a Picasa Web Album with some pictures of my current set-up.

https://plus.google.com/photos/116537260624791174138/albums/5694125632558529217

I hope that works. :slight_smile:

I'm pretty sure that it's wired up correctly, as I can fade colours across the whole array. I think the new capacitors may have made some difference, it seems I can light a few more LED strips with no problems now. :slight_smile: I also noticed that putting a capacitor between 12v and ground made things seem a little bit more stable.

I admit, it's not the neatest work ever...I've only just started.

Thanks!
Deeksie

Make the leads on those decoupling capacitors much shorter, they need to be as close as possible. It would also help to have a high value capacitor on those boards as well.
However your main problem is the length of leads you have, you are trying to put high speed digital signals through those leads and there is all sorts of cross coupling going on. Also the LEDs look to be a long way from the chips, this can cause oscillations as well.
You need to look at the signal integrity on a scope and see where it is going wrong. You also need to get rid of solderless bread board.
I had a similar problem with my Hexome Hexome and you will see I had to put very small capacitors on the LEDs.

Took everything you said into account, and decided to put the TLC5940's at the bottom of the light together, all with de-coupling caps, instead of on the light itself. Then used some ribbon cable to drive the LEDs from the bottom so it wasn't horrendously messy!

Also decided to use 3 TLC5940 and 15 strips, in stead of 2 and 10 as before, I think it's better.

Works great! Thanks so much for your helps guys, especially Grumpy Mike. :slight_smile: