difference between TLC5940 in DIL or TSSOP

Hi,

i have a question about the difference between the TLC5940 in DIL or TSSOP packages. Or is there ever any difference except the pin alignment?

background of my question is, i have some TLC5940 in TSSOP packages and i'm try to run them in serial (daisy chain). But already the second chip in the chain doing wrong. The first 3 ports doing the same as the first 3 ports of the 1th chip and all other ports are constant open.

I'm using this library Google Code Archive - Long-term storage for Google Code Project Hosting.

and this wiring http://students.washington.edu/acleone/codes/tlc5940arduino/img/breadboard-arduino-tlc5940.png on my Arduino Duemilanove with ATMEGA 328P.

I hope somebody can help me.
Thanks

Or is there ever any difference except the pin alignment?

The pin functions are identical because it is the same chip inside the package.

There is a difference in power dissipation due to the different mechanics, the TSSOP has a higher dissipation and is easer to mechanically fix a heat sink to. But the function is still the same so you would be having the same trouble with a DIL device.

Hi Grumpy_Mike,

thank you for your fast answer.
That was my last hope :-[

Have you some experience with the TSSOP version of the TLC together with the library I use on the Arduino?

Have you some experience with the TSSOP version of the TLC

No as I said they are the same.
It sounds like a software problem. Post you code (using the # icon)

I m using the example "BasicUse" from the TLC Library.
In tlc_config.h I set NUM_TLCS = 2 for my two TLCs.
The first TLC is working fine but the scond is doing mismatch.

In the tlc_config.h is witten, that after making changes to
this file, delete Tlc5940.o in this folder so the changes are applied.
But I do not have any Tlc5940.o file on my computer. Maybe is that my problem. Im using the latest Arduino IDE 0018.

/*
    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);
  }

}

But I do not have any Tlc5940.o file on my computer. Maybe is that my problem.

No now the .o file is generated each time so there is no need to delete it. On some older versions you had to manually delete the file. I think this change happened in version 17.

The code looks OK, what about supply decoupling on the chips? Also as it is a surface mount device how are you physically wiring them up? The second chip is not too far from the first is it?
You posted a wiring picture but as you have a surface mount it is not what you have wired. Have you a schematic?

I do all wiring on a breadboard. The wiring schematic is exactly the same as i posted on the wiring picture. The 5V for LEDs, TLC and Arduino comes from the USB Port or from additional Power Supply (no difference). The SMD TLCs have I soldered on a TSSOP to DIP adapter like this (http://www.nkcelectronics.com/tssop-to-dip-adapter-28pin-065mm-28065.html).

I agree that it sounds like a solder problem. Make sure you clean off the flux well and try a continuity test between all the pins of your smd component. That example should work. I have used it a few times with multiple chips.

But when I send the serial data from the Arduino directy on Pin SIN all TLCs running well. What packages type using you? DIL or TSSOP?

The wiring schematic is exactly the same as i posted on the wiring picture.

well it's not is it because the pinout of the TSSOP is different so you will have had to change the wiring layout to accommodate that.

Have you double checked that the pins are identified correctly?

Also you have not answered:-

what about supply decoupling on the chips?

You do need some even though that schematic might not have any on.

of course I have consider the different pinout. At this moment I do wiring the circuit again.

Sorry but I did not understand :frowning: . What does you mean with:

what about supply decoupling on the chips?

I don't use a a seperate power supply for the LEDs. If you mean that? But I use one 100nF capacitor for each TLC between GND and VCC.

So its done. I rebuild the wiring and have the same (...) result like before :frowning:

I have 5 TLCs tested in alternation, but I always get the same result.

Slowly I am crazy! :cry:

Did you have another schematic apposite to the TLC Library for me?

Ok, its late now. I go to sleep now.

Thanks for helping me.
Good night...

... when I switch the SIN Pin from the second TLC from SOUT (from the first TLC) to SIN from the Arduino (Pin 11), both TLCs working perfectly synchronal.

I use one 100nF capacitor for each TLC between GND and VCC.

That's what I mean about decoupling so you do have some good.

So if you feed both chips with the same signal they work the same. That means that one of these things is happening:-

  1. The serial out on the first TLC isn't working.
  2. You are not giving enough clock pulses to load both shift registers.
  3. The software is such that you are getting the memory you shift in corrupted or at least it is not what you thought it was.

So if you feed both chips with the same signal they work the same. That means that one of these things is happening:-

yipppi :slight_smile:

  1. The serial out on the first TLC isn't working.

But why not? All of my TLCs can not be defective. I hope so :slight_smile:

  1. You are not giving enough clock pulses to load both shift registers.
  2. The software is such that you are getting the memory you shift in corrupted or at least it is not what you thought it was.

That would mean the library has an error. Because I'm using only the examples from this.

Because I'm using only the examples from this.

Or you are not driving the library correctly or you have a wiring error.

I can't think of anything else.

At this stage you need an oscilloscope so you can see where you are going wrong. Lots of people have used this example and they have got it to work, therefore there must be something wrong with what you are doing.

I don't have an oscilloscope. :frowning:

OK, thank you very much for your help and patience!

If I could find the answer to this problem, I'll post it here.

Thanks!

OK sorry but I am at a loss to suggest anything else.
Anyone think of something not tried yet?

i understand:

you have tried different chips in diferent roles... first or second in the chain
and the chips in paralell to confirm basic functoionality

The only breakage appears to be in the SOUT -> SIN ?

Have you tried using different different locations on the bread board? it could be damaged on the sout pin of the first chip..

Dafid

The only breakage appears to be in the SOUT -> SIN ?

It's seems so. The first 3 ports of the second TLC do the same as the first 3 ports from the first TLC. All other ports from TLC 2 are open (LED on).

Have you tried using different different locations on the bread board? it could be damaged on the sout pin of the first chip..

An rebuild on another bread board makes no difference.

:smiley: :smiley: :smiley: :smiley: :smiley:
I've found the solution to the problem.

It was my fault. I had adjusted the wrong tlc_config.h file.
I had adjusted the tlc_config.h out oft the BasicUse example folder.
The correct file would be finde in the arduino-0018\libraries\Tlc5940\ folder.

Absolute Beginner Mistakes! >:(

OK, I say again thank you to all who helped me!