Daisy-chaining 7 IC's

So, I'm trying to stick seven tlc5940's together. After some reading I've discovered that the IC's ask for too much current to run seven at the same time from the same pins. A friend of mine told me that there are devices called "buffers" made to solve this problem, but neither of us know where to find them or which to get.

I would like to use these in a breadboard and they need to put out around 200 ma continuous. I need a total of five inputs and five outputs, and they need to be fast. I tried using 2N2222 transistors before and they couldn't keep up.

There's a datasheet for tlc5940's over yonder: http://www.sparkfun.com/datasheets/Components/General/tlc5940.pdf -- Any advice would be appreciated.

the IC's ask for too much current to run seven at the same time from the same pins.

Unless you have an IC from the 17th century, no need to worry about that.

they need to be fast. I tried using 2N2222 transistors before and they couldn't keep up.

How fast is "fast"? For switching applications, 2n2222 or any small signal transistors are good to 100Mhz+. If they couldn't "keep up", something else is wrong.

Around 1 ghz. ...The more I say that the more I realize something else is probably messed up.

So, here's a schematic. http://ompldr.org/vZzBsbw/101Leds-2.png I really didn't feel like trying to add every single LED, but I think you should get the gist off it. The grounds of the Arduino and the second PSU are linked and only the second PSU is supplying current to any of the lights. All the IC's also draw their VCC from that second PSU. The Arduino only has six wires coming off it -- The ones for controlling them, and ground.

I have tipple-checked the wiring and so has someone else. We're sure everything is plugged in correctly. The code does work with 1-2 IC's with no problems, but higher and I loose control of the IC's further down the chain. I'm using the library over're for communication: Google Code Archive - Long-term storage for Google Code Project Hosting. (Direct link: Google Code Archive - Long-term storage for Google Code Project Hosting. )

When I try to run the "basic use" sketch included with the library, which just turns the LED's on in sequence and does a sweeping pattern with 4 LED's lit at a time, it gets to what'd be the 4th or 5th IC and then stuff after that starts going weird. Random flickers and such. THey still have the sweep going across them when the times comes, but it keeps flickering too.

1ghz? Seriously?

That's like believing that your Ford Fiesta will go to the moon as long as it is pulled by 1000 horses.

My advice? Think about what you are trying to do and find the simplest way to do it with the lowest spec'd parts. aka "engineering".

1 GHz? Not from an Arduino you aren't.

Try some decoupling capacitors.

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Ah, that makes sense.. What value capacitor should I start with? I assume I'll need ceramic ones and the only ones I have on-hand are 22 pf, but I can go out and grab some relatively soon.

Also, what does the comment "\note The default of 8192 means the PWM frequency is 976.5625Hz */" in tlc_config.h mean, then?

For decoupling 0.1 uF are typically used.

And to be sure, does it matter what type I used or what polarity? Capacitors make me nervous. <.<

Kay! Forced myself to do it and nothing exploded! There is a problem, though.

First I used 10uf capacitors. Those caused all the LED's to stay dim. Then I replaced them with 22pf capacitors on the first chip (Only on pins 18 and 23-26). This didn't break things so I went and did the rest of the chips, pins 18 and 23-25 (left 26 out since that's the serial input and isn't directly "chained" to anything else.). This broke things. Now, whenever I connect the Arduino, all control goes out the window. Lights stay fully lit and occasionally flicker.

Based on this, is it still worth trying to find .1uf capacitors? And did I even put them on the right pins?

Generally 0.1 uF capacitor are not polarized. You would put them on the VCC (+5V) to each chip to smooth out any power variations which might make it malfunction.

Hey, that did something! It's a bit more stable now. Not totally fixed, but definitely better. I've only got 22 pf capacitors on hand so that's what I used and could be part of the problem.

Was I supposed to remove the wire I had there before and replace it with the capacitors, or do I have the wire /and/ capacitors?

I've only got 22 pf capacitors

Too small but if that's all you've got, try adding some more but go get some 100nF/.1uF caps, that's the usual size.


Rob

I'm gunna be ordering those within the next few days. 22 pf cleared up a lot more than I thought it would!

Was I supposed to remove the wire ...

What wire? You connect the capacitor between Vcc and Gnd. You don't change any wires.

The wire I have going from the +5 volt rail to the VCC pin on the IC. Nevermind though, figured out it won't work on my own.

I can't find 100 nF capacitors. I've found 100 pF ones, but not nF. Am I looking in the wrong place on Digikey? I thought they'd have to be ceramic.. I'd like to order some of each (.1 uf and 100 nf) just in case stuff happens.

100nF = 0.1uF

Kay! Forgot this existed!

So, the decoupling capacitors didn't work. They helped a little but not enough.

Common sense struck. I wired the LED's to a different PSU than the IC's and now they work "fine". It fixed my problem but a new one came up, then I fixed that and... Well, long story short, things are worse now than they were before.

It all started when I added the second PSU -- I now have an ATX running the LED's that can drive up to 20 amps. Yeah, totally overkill, but at least I know I can turn them all on at once and nothing will blow up. Apparently I moved something around, because unknown to me, the 6th IC popped up /juuuust/ right so that five of its output pins and the Serial Outpit pin came out of the breadboard. This went unnoticed for a few days before I pushed it back in.

Doing that fixed "everything", except that when I toggled too many LED's on at once the 6th IC would turn all its outputs on. I have no idea why it did this but obviously this had to be fixed. I checked the wires, all good. No shorts anywhere, no components touching, nothing. There was no logical reason for it to be acting up..

..Then I had someone else look at it and we noticed that some of the 5th's LED's were acting up too. Checked the wiring and such, all good again. We figured that the IC had to be faulty so I swapped it out. Nope! Things got worse. Now none of the 5th's LED's light, but it gets weirder -- It's not broken. It's still getting serial data and passing it to the next chip in the chain. I even replaced it /again/ (this time with a chip from a new batch) and it did the exact same thing. Kinda.

The new IC listens, but it doesn't do exactly what I say all the time. If I only tell it to light one LED at a time, I can make all the LED's in the display go on and off in sequence and it works like a dream (almost). If I turn them all on at once, the ones controlled by the 5th IC are flaky. Usually they'll light but be very dim. If I bring the PWM duty cycle down sometimes they'll light as bright as all the other LED's, sometimes not. There seems to be no rhyme or reason to it.

Oddly, if I turn on individual LED's controlled vby the 5th IC, then turn all the LED's on, the ones I turned on remain fully bright while the others are dim. I can't even begin to fathom what's going on.

Worse still, now the LED's connected to the 7th chip won't respond at all anymore. They're always off. I don't think this is the 5th's fault, since the 6th still works absolutely perfectly. The 7th worked fine before but now it don't. Gah.

So, I'm stumped. I don't know where to start trying to fix things at this point. I suspect my house has been built over an Indian burial ground and I've been cursed with bad juju. What do I do?

EDIT: Forgot to mention that I did remember to tie the ground lines together, and didn't tie the 5 volt rails together. I might be stupid sometimes, but I know not to pump 20 amps into a laptop's USB port.

Have you tried starting with one chip and working up until the problems start?

Also, what's the total current wit all LEDs on? Maybe the switch from none to all is too big a shock to the PSU. Try a couple of large caps (1000uF or so) near the LEDs and/or chips.


Rob

I have, but I did it again for kicks. I added groups of six LED's on at a time (There's 24 of each color, four colors, then 5 ones hanging upside-down). When I got to the ones the 5th controlled, adding 6 made the previous 6 controlled by the same LED get dimmer. This makes me wonder if the breadboards are broken. Maybe it's got some wires crossed internally?

I'm not sure what the total current draw is. I know it's between 2 and 3 amps. I added the capacitor like you asked and that fixed the 12 volt ones... Only, it's not part of that circuit. I stuck a 2200uf capacitor between the 5 volt LED's +v rail and ground. The 12 volt rail for the other 5 LED's is its own thing and somehow that fixed it. Even after removing the capacitor it still works.

They are flickering though, which leads me to believe that they're getting some odd commands somehow. It's not terribly noticeable but it's there and there's a clear "beat" to how often they flicker. It changes roughly 3-4 times a second. I've seen this happen before when one of the IC's was partially unplugged but I already checked and none of them are up. Plus, the 6th IC's LED's still work fine. Only the 7th's flicker, and it's the 5th's that are acting /really/ weird. The 6th's should be flickering too if the 5th wasn't plugged in properly but they're not, and the 6th would have some LED's dead if it wasn't plugged in properly and none are, so... Yeah.

Sorry if any of this is worded bad. It's nearly five in the morning here.

TLC5940s need good grounding and good decoupling. It might help if you post a photo of your layout.

A photo's gunna be a little hard to get. There's about 200 wires that get in the way, but, here'ya go: http://i47.tinypic.com/23kwuiu.jpg It's a little outdated but it's close enough. Pretty much all that's missing is the ATX supply.

I'll take more recent ones if you want but I'd like to know what to even aim at, and how, for that matter.

What do you mean by "good grounding" exactly? Should I have more wires leading to the ATX's ground or something?