I purchased a few texas instruments tlc5940(http://focus.ti.com/docs/prod/folders/print/tlc5940.html) led drivers to play around with. These are the first integrated circuits that I am trying to work with, and I haven't been able to get it to work.
After going over the datasheet many times over the past few days and trying 100 different things, I feel it is time to ask for some help.
My current setup on my breadboard is the following:
TLC5940 pin: Connected to
28(out0): led to gnd
27(vprg): gnd
26(sin): arduino pin 2
25(sclk): arduino pin 3
24(xlat): arduino pin 4
23(blank): arduino pin 5
22(gnd): gnd
21(vcc): +5v
20(iref): 220 ohm resistor to gnd
19(dcprg): gnd
18(gsclk): arduino pin 9
17(sout): arduino pin 10
16(xerr): no-connection
all other pins: no-connection
The following is the code I am trying to achieve this goal with.
int gsClk = 9;
int sIn = 2;
int sClk = 3;
int xlat = 4;
int blank = 5;
int sOut = 10;
void setup()
{
delay(1000);
pinMode(sIn, OUTPUT);
pinMode(sClk, OUTPUT);
pinMode(xlat, OUTPUT);
digitalWrite(xlat, LOW);
for(int x = 0; x < (196); x++)
{
digitalWrite(sIn, HIGH);
digitalWrite(sClk, HIGH);
digitalWrite(sClk, LOW);
}
digitalWrite(sIn, HIGH);
digitalWrite(sClk, HIGH);
digitalWrite(sClk, LOW);
digitalWrite(xlat, HIGH);
digitalWrite(xlat, LOW);
pinMode(gsClk, OUTPUT); // sets the pins as output
//analogWrite(gsClk, 0xFF); // was trying to just use pwm for the clock
pinMode(blank, OUTPUT);
digitalWrite(blank, HIGH);
digitalWrite(blank, LOW);
digitalWrite(sClk, HIGH);
digitalWrite(sClk, LOW);
Serial.begin(9600);
pinMode(sOut, INPUT);
}
int foo;
void loop()
{
for(int x = 0; x < 4096; x++)
{
digitalWrite(gsClk, LOW);
digitalWrite(gsClk, HIGH);
}
// 'Greyscale pwm operation' of the datasheet(page 16) says that
// blank should be pulsed after a full pwm cycle. this works neither pulsing it or not pulsing it
//digitalWrite(blank, HIGH);
//digitalWrite(blank, LOW);
}
After this starts running, out0 and all other outs show low on my multimeter. xerr and sOut also show low on the multimeter. Is there something that I am missing? Has anyone else worked with this IC and have code that I can look over?