Help with TLC5940

Hello!

I have been trying to connect a TLC5940 IC using an Arduino Uno forever, but nothing seems to work.

I've followed countless tutorials and read every post regarding issues with the TLC, but nothing seems to work.

Currently wired is:
Uno -> TLC
Pin 3 --> Pin 18 (GSCLK)
Pin 9 --> Pin 24 (XLAT)
Pin 10 --> Pin 23 (BLANK)
Pin 11 --> Pin 26 (SIN)
Pin 13 --> Pin 25 (SCLK)

Pin 21 (VCC) and pin 19 (DCPRG) is connected to VCC
Pin 22 (GND) and pin 27 (VPRG) is connected to ground.

Pin 20 (IREF) has a 2k2 resistor to GND.
I've tried putting a 10k pull-up resistor from BLANK to VCC, but I've also tried without this resistor.
I have a 0,1uF capacitor between VCC and GND close to the IC.

LED's are connected with the anode to VCC and cathode connected to the legs of the TLC.

The green LED is just to indicate that the IC is actually powered.



This is the code I've currently uploaded to the arduino UNO:

#include <Tlc5940.h>

int nLeds = 16;

void setup() {
  Serial.begin(9600);
  Tlc.init();
  Tlc.setAll(0);
  Tlc.update();
}

void loop() {
  for(int i = 0; i < nLeds; i++) {
    Tlc.setAll(0);
    Tlc.set(i, 4095);
    Tlc.update();
    Serial.println("LED ON");
    delay(1000);

    Tlc.set(i, 0);
    Tlc.update();
    Serial.println("LED OFF");
    delay(1000);
  }
}

The outputs LED ON and LED OFF are registered in the serial monitor as expected.

But I've tried all kinds of different code, also from other posts where people seemed to have fixed the issues and got it working. Nothing seems to work in this case.

The TLC_NUM is 1 in the config file.

Please help! I must be missing something completely obvious :(

Please post the GitHub link to the library used.

What I miss in your code is how it knows to use pin 3?

(also true for some other pins used)

I don't have that type of breadboards - do they have continuity between the pins on the side ?


am I assuming right that you are using this lib ?

Also missing the constructor for the TLC object.

if that's Paul's library, then it's the typical use case

pins are hardcoded

I am using this library:

Yes, it does have continuity between the pins on the side, to around midways. But I'm only using one half, so that shouldn't be an issue

You are correct, that is the library used

I was under the impression that these pins are the default pins according to the library, and that one should only redefine if other pins are used. Am I wrong about that?

Can you maybe elaborate? Thank you!

In the library there is a comment

The TLC5940 chip SCK pin is sensitive to signal overshoot. When used with Teensy 4.0 or other high speed hardware, especially if using long wires, you may need to add a resistor inline with the SCLK signal.

May be worth considering? (Although you have a uno)

Considering the DIP version is an obsolete part and no longer manufactured are you sure you have a genuine TLC5940

I used three TLC5940 chips when I made my Hexome, because it was all that was available at the time. The problem with the chip is that it needs constant refreshing to keep it alive.

This is a link to my show case post on it.
Hexome demo

So putting a

[quote="flying_kangaru, post:1, topic:1429555”]
delay(1000);
[/quote]

Is going to kill any refreshing stone dead.

Sadly my Web Site was cut off when my ISP pulled the plug on it a few years back, but you can still get to it through the way back when machine I believe.

You can see the details schematics and background information here
Hexome processor schematic.pdf (45.0 KB)

This is the way the LEDs / push buttons are assigned to points on the instrument.


Hexome Block Diagram.pdf (27.0 KB)

Nowadays you would use a more set and forget chip rather than this one. Like the PCA9685.