Go Down

Topic: TLC5940/Uno interface problem (Read 8730 times) previous topic - next topic

Av8ter

I am in the process of testing  3 TI TLC5940 16 Channel LED Drivers recommended to me in the Project Guidance section for a Kaleidoscope Digital Clock I'm trying to build.  I am using the BasicUse sketch from the TLC5940 examples file with the following connections:
-  +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)
- (Optional): put a pull-up resistor (~10k) between +5V and BLANK so that
                 all the LEDs will turn off when the Arduino is reset.
The sketch compiles and uploads, but absolutely nothing happens when I reset.  I have checked the continuity of all the connections, and tested the Common Anode RGB pins across a resistor to ground, and everything checks o.k.  I have a 0.1uf capacitor between pin 21 (VCC) and pin 22(GND) and a 2K2 resistor on pin20(IREF).   I have set  the NUM_TLCS  to 1   in the tlc_config.h file.  I have included the Tlc5940 and Wiring_Library_SoftPMW_v0005 in the Arduino libraries file.   Do I have the correct libraries?  I get no joy on any of the TLCs.  This is making me crazy.  Thanks for any help.

Av8ter

I should have been more clear in the above post,  I am testing the TLC5940 chips one at a time.  Thanks.

raschemmel

RGB LED has 4 pins right ? (1 anode & 3 cathodes). How do you have the leds connected ?

Av8ter

Yes, there are 4 leads per LED.  I have 5 LEDs  and  have the anodes connected  to+ 5V and each of the RGB  pins  to  separate TLC channels (0-14) for a total of 15.  I have pictures but don't know how to attach them to a post.

raschemmel

click on "Additional options in lower right corner of window.

Grumpy_Mike

We need a schematic of what you have wired and your code.

Read the how to use this forum sticky post.

Av8ter

Here  are images of the BB and Uno, the link to the TLC5940 library and the BasicUse code from the examples file in the TLC library and an image of how I tested each LED cathode lead.  Thanks again for your time and effort.
[/img]
Code: [Select]
/*
    Basic Pin setup:
    ------------                                  ---u----
    ARDUINO   13|-> SCLK (pin 25)           OUT1 |1     28| OUT channel 0
              12|                           OUT2 |2     27|-> GND (VPRG)
              11|-> SIN (pin 26)            OUT3 |3     26|-> SIN (pin 11)
              10|-> BLANK (pin 23)          OUT4 |4     25|-> SCLK (pin 13)
               9|-> XLAT (pin 24)             .  |5     24|-> XLAT (pin 9)
               8|                             .  |6     23|-> BLANK (pin 10)
               7|                             .  |7     22|-> GND
               6|                             .  |8     21|-> VCC (+5V)
               5|                             .  |9     20|-> 2K Resistor -> GND
               4|                             .  |10    19|-> +5V (DCPRG)
               3|-> GSCLK (pin 18)            .  |11    18|-> GSCLK (pin 3)
               2|                             .  |12    17|-> SOUT
               1|                             .  |13    16|-> XERR
               0|                           OUT14|14    15| OUT channel 15
    ------------                                  --------

    -  Put the longer leg (anode) of the LEDs in the +5V and the shorter leg
         (cathode) in OUT(0-15).
    -  +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)
    -  The 2K resistor between TLC pin 20 and GND will let ~20mA through each
       LED.  To be precise, it's I = 39.06 / R (in ohms).  This doesn't depend
       on the LED driving voltage.
    - (Optional): put a pull-up resistor (~10k) between +5V and BLANK so that
                  all the LEDs will turn off when the Arduino is reset.

    If you are daisy-chaining more than one TLC, connect the SOUT of the first
    TLC to the SIN of the next.  All the other pins should just be connected
    together:
        BLANK on Arduino -> BLANK of TLC1 -> BLANK of TLC2 -> ...
        XLAT on Arduino  -> XLAT of TLC1  -> XLAT of TLC2  -> ...
    The one exception is that each TLC needs it's own resistor between pin 20
    and GND.

    This library uses the PWM output ability of digital pins 3, 9, 10, and 11.
    Do not use analogWrite(...) on these pins.

    This sketch does the Knight Rider strobe across a line of LEDs.

    Alex Leone <acleone ~AT~ gmail.com>, 2009-02-03 */

#include "Tlc5940.h"

void setup()
{
  /* Call Tlc.init() to setup the tlc.
     You can optionally pass an initial PWM value (0 - 4095) for all channels.*/
  Tlc.init();
}

/* This loop will create a Knight Rider-like effect if you have LEDs plugged
   into all the TLC outputs.  NUM_TLCS is defined in "tlc_config.h" in the
   library folder.  After editing tlc_config.h for your setup, delete the
   Tlc5940.o file to save the changes. */

void loop()
{
  int direction = 1;
  for (int channel = 0; channel < NUM_TLCS * 16; channel += direction) {

    /* Tlc.clear() sets all the grayscale values to zero, but does not send
       them to the TLCs.  To actually send the data, call Tlc.update() */
    Tlc.clear();

    /* Tlc.set(channel (0-15), value (0-4095)) sets the grayscale value for
       one channel (15 is OUT15 on the first TLC, if multiple TLCs are daisy-
       chained, then channel = 16 would be OUT0 of the second TLC, etc.).

       value goes from off (0) to always on (4095).

       Like Tlc.clear(), this function only sets up the data, Tlc.update()
       will send the data. */
    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() sends the data to the TLCs.  This is when the LEDs will
       actually change. */
    Tlc.update();

    delay(75);
  }

}


Av8ter

Again, I apologize for poor technique.  Here is a better image of the LED test and a current image of the pin in and pin out of the TLC.  Thanks

raschemmel

You're +5V is going only to the chip and not to the power bus . Is that intentional ? Same for the ground.

Av8ter

No, the +5v jumper was pulled inadvertently before I took the picture.  I plugged it back in, but it is still not working.  I am coming off of the Uno and jumping the +5v and GND to the top power buss, and then jumping from that buss  (+5v ) to the bottom buss and GND off the GND pin next to pin 13 on the Uno.  Is this a problem?

raschemmel


Av8ter

The TLC5940 plays a big part in this project.  Can anyone help with problem please.  Thanks.

raschemmel

My advice to you is take the circuit completely apart and start over. Also , next time order a spare chip. I don't know what else to tell you. If I were there I could tell you if the chip was bad (I have one here running that sketch) (I ordered 5 chips because I already
fried one by mis-wiring it. If you're sketch compiles I think that means the library is installed. How many times have you checked the wiring ?

Av8ter

Thanks for coming back.  I've have just checked the wiring again.  Every wire is where it should be, and the continuity is there.  I have tried 3 different TLC5940s and two Unos, still with no joy.I'm really stymied.  I might try a  different tack,  the Mega2560 with the appropriate resistors and transistors  on the RGBs.  Thanks again for your patience and help.

raschemmel

I'm still not seeing the connection from Arduino  GND & +5v to the power bus.  Can you take a better photo so I can see all of the arduino to breadboard wires ? My TLC5940 worked the first time. It wasn't until I took the circuit apart and then rewired again later that I miswired it and fried one.

Go Up