Go Down

Topic: Library for TLC5940 16-channel PWM chip (Read 87676 times) previous topic - next topic


from my understanding the output always has to pass thru the constant current driver.

However you could pull up the output to vcc then a value of 4095 should make the output gnd allowing you to turn on and off a transistor... i think...

I am currently doing multiplexing by using npn transistors to selectively turn on the red-green-blue parts of a RGB common cathode led.

there is also a tlc5940mux library however i have never used it.


Hi all,

I'm using a PIC to control the TLCs, but still in principle it the same as the arduino. The only problem is the LEDs flicker. Does anybody know why this happens? I am programming at 48MHz, but still it's flickering. I am not using any interrupts. Should I use interrupts?


i know this is an old thread now... but i'm having a helluva time finding these chips online. if anyone has any leads or extras their willing to sell that would be great.

email is best but a PM would work as well.



Try TI directly! They'll send you free samples if you're lucky! (ti.com) Dani


Dec 31, 2009, 04:18 am Last Edit: Dec 31, 2009, 04:19 am by nphillips Reason: 1
has anyone used the tlc5940 with i2c at the same time.  im trying to and getting corrupt data when receiving.  Serial works just fine at speeds of 115200 but i2c does not work.
I'm having the same problem.

I'm running I2C between two arduinos, and the Master_Send and Slave_receive examples work perfectly. That is, until I add the slave_receive code to my Arduino running the TLC...

I commented out everything related to the TLC, and it worked. Adding things back in one at a time (headers, global variables, etc.) worked until I hit Tlc.init(); At which point I2C died.

Could you find a solution, joe? (or anyone?)


Hi everyone i am interested in doing a 16x16 display with the TLC but i am not quite sure about what baud rate should I use.
I'm planing on sending the data from my computer and it seems i'll have to send the data directly to the TLC, so can anyone give me more info about the baud rate I should use. What is the maximum baudrate that the TLC can work, how many stop bits, should i include a 9th parity bit?
Thanks a lot in advance for your help


the tlc5940 runs off an spi bus.  not serial.


OK i get it now, but still my initial plan is wailing me. I was planing to update the picture from the computer and change it during execution, but it seems almost impossible to be done in time. :'(
I will have to have my picture stored in the microprocessor before I start displaying it.   :-[
Is that what all you guys are doing or are you actually able to change the image trough some kind of communication with a computer?


well then ill show you something its possible.
im sending RGB as bytes to the atmega168 over serial then sending it to a master Atmega168 via i2c. ill post more info later


ill upload a video of my full project later today or this week


Heres my project using 7 tlc5940's to control 112 led's



Feb 17, 2010, 12:49 am Last Edit: Feb 17, 2010, 12:53 am by nphillips Reason: 1
WOW. Well done, Joe! I love it!

Where's the code? ;)

Do you have any close-ups of the individual cells? It looks like you have the LEDs mounted to the sides of the boxes, rather than the bottom.

Something like this has been on tap for me, for a while now...I just need the time and resources to do it.

Excellent craftsmanship, as well as programming!

EDIT: Hang on...how many TLCs are you using? you said 7 TLCs, which is 112 LEDs max. But there are 112 cells in your table, which should be 336 LEDs, and 21 TLCs. Are you multi/charlieplexing them?


multiplexing the anodes of common cathode led's

ill make a large exhibition post tonight at link to it here.



theres my exhibition post.

if you have questions regarding my specific application please direct them there


I was wondering if this library would also work with one of the following chips:

TLC5941 - http://focus.ti.com/docs/prod/folders/print/tlc5941.html
TLC59401 - http://focus.ti.com/docs/prod/folders/print/tlc59401.html

And if they could be used would it also be possible to mix them? I.e. have 2 TLC5940's + 2 TLC5941's + 2 TLC59401's working together.

Personally I don't see a whole lot of differences between them comparing their datasheets. Pin configuration seems identical as is the way they are controlled.

The only differences I could find:
TLC5940: EEPROM and 60mA (Vcc [ch8804] 3.6V) / 120mA (Vcc > 3.6V) drive (per channel)
TLC5941: NO EEPROM and 80mA drive (per channel)
TLC59401: NO EEPROM and 80mA (Vcc [ch8804] 3.6V) / 120mA (Vcc > 3.6V)


I just got some TLC5941's and have run a couple of the examples in the library. So far I haven't run into any problems.

Go Up