I've shifted to the TLC5940NT from using a TPIC6C595 after not getting ShiftPWM to work properly.
I am trying to push a series of 12v RGB LEDs using a TLC5940 but only get a bright signal when my Uno restarts. After the Uno initializes, I only get a faint, flickering output on each LED.
No matter which code I use, it is the same issue, so I have to assume it's a hardware issue.
One sketch I have tested is the BasicUse example as follows:
#include "Tlc5940.h"
void setup()
{
Serial.begin(9600);
Tlc.init();
}
void loop()
{
int channel=0;
for (channel = 0; channel < 16; channel++){
Serial.print(channel);
Tlc.set(channel,4000);
Tlc.update();
delay(200);
Tlc.set(channel,1000);
Tlc.update();
delay(200);
}
channel=0;
}
Another is the "KnightRider" swipe:
#include "Tlc5940.h"
void setup()
{
Tlc.init();
}
void loop()
{
int direction = 1;
for (int channel = 0; channel < NUM_TLCS * 16; channel += direction) {
Tlc.clear();
if (channel == 0) {
direction = 1;
} else {
Tlc.set(channel - 1, 1000);
}
Tlc.set(channel, 4095);
if (channel != NUM_TLCS * 16 - 1) {
Tlc.set(channel + 1, 1000);
} else {
direction = -1;
}
Tlc.update();
delay(75);
}
}
The circuit is wired as per the library example as follows:
+5V from Arduino -> TLC pin 21 and 19 (VCC and DCPRG)
GND from Arduino -> TLC pin 22 and 27 (GND and VPRG)
digital 3 -> TLC pin 18 (GSCLK)
digital 9 -> TLC pin 24 (XLAT)
digital 10 -> TLC pin 23 (BLANK)
digital 11 -> TLC pin 26 (SIN)
digital 13 -> TLC pin 25 (SCLK)
2K resistor between TLC pin 20 and GND
Do I need a decoupling capacitor?
Is the Uno too fast for the TLC?