Go Down

Topic: TLC5940 + high current (Read 11 times) previous topic - next topic

rocketgeek

Add a small resistor in series between the gate and the 5940 output pin -- enough to keep the current within spec assuming a momentary (tens of ns) dead short from the gate to +12V. I'll get to why in a sec.

Mosfets are turned on/off by adding/removing charge from the gate. The amount of charge required is called the gate charge, abbreviated Qg on datasheets, and generally measured in nano-coulombs (nC). Small power mosfets in the 20-30V range often have Qg of ~1 nC; Qg goes up with device size and voltage.

In order to keep the mosfet saturated and dissipating the minimum amount of heat, you want to get that charge on and off there are fast as humanly possible. The gate is a capacitor, so it can source/sink surprisingly large current peaks. Big mosfet drivers can often source and sink gate current of 2-3A for a few ns each cycle, and I've seen discrete power circuits to drive even larger gate currents still for switching really big mosfets. The pull-up resistor needs to be sized so that the current that it allows to flow into the gate during is as large as possible without burning the 5940 when they are all on full.

nemik

#11
Jul 01, 2009, 03:06 am Last Edit: Jul 01, 2009, 03:03 pm by nemik Reason: 1
rocketgeek:

Thanks for these tips. I'm in the exact same situation. I tried your suggestion using a J176 (http://www.fairchildsemi.com/pf/J1/J176.html) P-channel FET. Unfortunately, the LED just stays lit the entire time. Any other suggestions?

I'm really confused as to why a P-channel isn't working in this case though.

EDIT: nevermind, i'm dumb. forgot the 10k load resistor from drain to GND, works perfectly with it.

hcgilje

Hi,
I have been trying to get the tlc5940 to work with high current leds in combination with a npn transistor and a constant current regulator, and have some issues, which makes me wonder if I am doing something wrong either on the hardware side or the software side (already posted a similar post in the tlc5940 library thread without any replies).

I had no problems getting the tlc to work with 16 normal eds and using the "basic use" sketch from the examples.
I want to use it for LEDs which draw more current than what the tlc5940 can handle, and after some research here in the forums I found two solutions, either using a mosfet or a NPN transistor.
I decided to go with the NPN solution.

I hooked up 5 high current leds (3W, drawing 700mA each) on the first five channels, and used normal leds for the rest of the channels.
I used a 10k pull-up resistor for each of the high current channels, each channel connected to a tip122 (through a 1k resistor) which again is connected to the led and a constant current regulator (LM317).
The Iref resistor is 2k (so about 20mA current from the tlc5940).
See the schematic for more details.
http://www.bek.no/~hc/downloads/powerled_schematic.png

As exected the values are reversed so 0 is on and 4095 is off.

I made an extremely simple sketch, first one with only turning on/off channel 0, the first of the high current leds.
The led turned on/off as expected. However, the other channels behaved strangely, going on and off more or less randomly (at least I haven´t found a logic to it yet), often many of them turning on/off at the same time.

When I expanded the sketch to turn on/off all the high current leds in a sequence, they behaved as expected, but again, now and then the other channels behaved strangely.

Today I hooked up 6 more, so a total of 11 leds, and this produced some very inconsistent results, so I don´t know where I am doing something wrong.

Here is the simple test code I used with the five leds:

Code: [Select]
#include "Tlc5940.h"

void setup()
{
 [shighlight]Tlc[/shighlight].init();
// I added these two lines to see if it helped, but they didnt make a difference
  [shighlight]Tlc[/shighlight].clear();
  [shighlight]Tlc[/shighlight].update();
}
void loop()
{
 tlcflash(0);
 tlcflash(1);  
 tlcflash(2);  
 tlcflash(3);  
 tlcflash(4);  
}

void tlcflash(int [shighlight]tlc[/shighlight]) {
 [shighlight]Tlc[/shighlight].set([shighlight]tlc[/shighlight], 0);
 [shighlight]Tlc[/shighlight].update();
 delay(1000);
 [shighlight]Tlc[/shighlight].set([shighlight]tlc[/shighlight], 4095);
 [shighlight]Tlc[/shighlight].update();
}


thanks for any input.

hc

Grumpy_Mike

If you remove some LEDs does the behavior change or does it remain the same for the same pins?

I suspect it changes, this sounds like a classic case of lack of decoupling on the power supply both to the chip and to your power LEDs. By this stage you are switching a lot of current and if your layout and decoupling is not up to scratch then this is the sort of behavior I would expect.

hcgilje

I will check more tomorrow, but you are suggesting adding decoupling capacitors?

hc

Go Up