Library for TLC5940 16-channel PWM chip

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. :cry:
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

WOW. Well done, Joe! I love it!

Where's the code? :wink:

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.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1266369410/0#0

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 - TLC5941 data sheet, product information and support | TI.com
TLC59401 - TLC59401 data sheet, product information and support | TI.com

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.

Thanks AC great library.

Is it possible to control the brightness of each channel?
If yes can someone please provide a sample of where they have done it?

Or

Would it be easier to have another chip controlling a say mosfet to control each intensity.

Right now my setup is 3 TLC -> (3)Mosfets -> (1)RGB_LED

I thought about adding in a 4th TLC to control the common for intensity.

Let me know,
Ram

Oh yes one more question.

Is it possible to bitshift or do something to turn 0 into 4096 and 4096 into 0 for n channel fets?

int i = 2000;
int inverse = abs(i-4096); //subtracting 4096 makes it inverse, but negative, abs converts negative to positive, making the conversion complete

Hope that helps =)

Hi I noticed this interface in your initial email and wondered if it was by design ?
Tlc.setPWMperiod(PWM period (0 - n) milliseconds);

I read in the data sheet that the chip can have a max clock of 30MHz/ which works out at about 1/7th msec per 4096 clock pulses.

I guess that means the arduino has order of 2k instructions per cycle...

is that feasible?

Thanks on the code for inverse.
I was actually thinking about adding a !buffer chip to invert the outputs to drive the mosfets off when the signal is off / lost.
As for the pwm output i was wondering that myself I havnt seen it in there I think it had to be fixed when it changed to spi mode instead of bitbang.

Ram

=== code
int i = 2000 ;
int inverse = abs(i-4096) ;
=== or
int i = 2000;
int inverse = 4096 - i ;

below is a little smaller and simpler.

when would
int inverse = (4096-i)
be negative if you are inputting 0 and 4096? Unless you are going to put in values larger than 4096, I agree with dafid and you don't need abs().

I realise that now I was in the middle of a game when I posted :P.

Has anyone tested the Library from AC with the TLC5940 in the TSSOP packages? I have a big problem with more than one TLC. Maybe you can watch my thread here:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1268821919/0

Hi,
I'm using the TLC5941 and it's working great except for the fading function for the arduino to control 5 RBG LEDs (15 channels).

so I have a function with this

  tlc_addFade(channel, Tlc.get(channel), green, millis(), millis()+(duration*60) );
  tlc_addFade(channel+1, Tlc.get(channel+1), red, millis(), millis()+(duration*60) );
  tlc_addFade(channel+2, Tlc.get(channel+2), blue, millis(), millis()+(duration*60) );

I would send in 'duration' to being like 300, making the transition to take place over hours. But the transitions occurs within seconds. Do you know what the issue could be?

Thanks.

Sorry, but I have not yet used fading. All I know is that it gives an example in the TLC library to do so.

*** Documentation Bug Alert ***

Alex,

Thanks for the library - works great for me!

There is a small documentation bug on the page for VPRG_ENABLED:

It says

"You will also have to connect Arduino digital pin 6 to TLC pin 27"

Actually, the library uses Arduino pin 8, not 6. I stumbled over this
and dug through the pin definitions to find the problem.

Best,
-- Terrence