TLC5940NT not working?

Hi. I just bought a TLC5940 and followed the diagram on this page: http://www.arduino.cc/playground/Learning/TLC5940 wiring it up. As far as I can see, it’s all correct, but nothing is happening with the basic code I loaded on to it:

#include <Tlc5940.h>
#include <tlc_animations.h>
#include <tlc_config.h>
#include <tlc_fades.h>
#include <tlc_progmem_utils.h>
#include <tlc_servos.h>
#include <tlc_shifts.h>

int i = 4095;

void setup(){
Tlc.init(4095);

}

void loop(){
Tlc.setAll(i);
Tlc.update();
i--;
if(i == 0) i = 4095;

}

There is an RGB led wired with correct resistors etc. to the outputs 0,1,2, but it doesn’t light up or anything. Anything else I need to be doing to get it working?

Thanks,
Singul4r1ty

There is an RGB led wired with correct resistors etc. to the outputs 0,1,2, but it doesn't light up

You don't need a resistor with these chips. Is it a common anode type? You need the LED's anode to 5V and the cathodes to the outputs.

Yeah, I just realised that they sink current, not source current. So I need a different chip to use the LEDs I have. I've looked at the MAX7221 but that drives a matrix. Although I suppose you could wire them as a matrix. Are there any ICs that can source current and give me a good PWM, preferably 12-bit or more?

I just hooked up my 5940 a few nights ago and it works great! Really easy to use with the library. My project is not a matrix so this chip is just right for me. Have you thought about just getting some new common anode LEDs? I just bought 50 RGB LEDs from c-leds.com for under $20. They even threw in a four extra LEDs and shipping was very fast.

Tim

I mentioned this earlier: add pullup resisters so the device can sinck 5mA, and drive an inverter like 74AC240 (good for 24mA) to drive the common cathode LEDs. Check the PN at digikey, might have been 74ACT240.

Here's the thread http://arduino.cc/forum/index.php/topic,65891.msg494243.html#msg494243

drive an inverter like 74AC240 (good for 24mA) to drive the common cathode LEDs.

If you do this then you can't ever turn of the LEDs completely, this is because they are never 100% fully turned on.

Are there any ICs that can source current and give me a good PWM, preferably 12-bit or more?

Not that I know of.

But the '5940 is putting out a 0-5V PWM squarewave, isn't it? So why wouldn't the LEDs be off when the '5940 output was sitting at 5V? I have a couple of the chips, guess I need to add to my projects to attempt list.

If you invert the signal the sitting at 5V is on and sinking current is off. The chip never is 100% on that's it never sinks all the time. It is so little not 100% on that you don't notice. But when you invert the signal this means it is never fully off.