Pages: [1]   Go Down
Author Topic: Tlc5940s go crazy when addressing more than about 6 channels.  (Read 1146 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. :-) 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. :-P

Deeksie
Logged

Yorkshire England
Offline Offline
Sr. Member
****
Karma: 2
Posts: 267
Arduino good init
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley

Thanks guys!

Deeksie
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. :-)

Deeksie
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It could be your layout can you post a photo?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley

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. smiley 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
« Last Edit: January 05, 2012, 07:44:13 am by Deeksie » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34567
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 http://www.thebox.myzen.co.uk/Hardware/Hexome.html and you will see I had to put very small capacitors on the LEDs.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. :-)
Logged

Pages: [1]   Go Up
Jump to: