Pages: 1 ... 12 13 [14] 15 16 ... 18   Go Down
Author Topic: Library for TLC5940 16-channel PWM chip  (Read 25337 times)
0 Members and 1 Guest are viewing this topic.
Eindhoven, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thx for the quick reply!

I just tried putting the resistors in. The 1k resistors didn't do much. I searched around a bit on the internet and apparently it's called termination. To calculate the proper resistance I need to know the impedance of the 12 ribbon cables + 12 boards + connectors. I now used 4 x 100 ohm resistors because on some websites they were talking about 50 - 135 ohm resistors all the time. These worked a lot better. I can drive all LEDs however during quick updates (<10ms) the last boards flicker. So hopefully I can finetune the flickering by trying out some other resistors.
Does anybody have tips or tricks on how to estimate the exact correct resistance?
Is it possible to reduce the speed of the tlc clock? Because decreasing the speed would lengthen the maximum allowed length of the leads as far as I've been able to get out of the online stuff which is too complicated for my designer electronics skills smiley.
Logged

Seattle, WA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
Arduino rocks my socks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Chronoless:

You can lower the update speed by commenting out
Code:
SPSR = _BV(SPI2X); // double speed (f_osc / 2)
in Tlc5940.cpp (line ~327).  That will reduce the speed by half.  If you need to go even slower, see "SPI clock rate select" on pg 170 of the datasheet.

Where are the resistors connected?

Everyone:

I finally got around to replacing my horrible ascii pin-out diagram!  This is my first time using inkscape: anything I should change with my png?  (inkscape svg source)


I got the breadboard from follower.
Logged

Eindhoven, the Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Reducing the speed didn't help to prevent the flickering.
I've connected the resistors between the last (12th) tlc board and the arduino pins (so that it makes a circle). That was most convenient to test. Should I put them somewhere else?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I am trying  to get the TLC5940 to work with a DMX-512 receiver project.
And I am out of luck smiley-sad
I think the problem is that TIMER2 is used in both project. Does anyone have any suggestions??
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a link to the receiver project

http://blog.wingedvictorydesign.com/2009/03/20/receive-dmx-512-with-an-arduino/
Logged

Seattle, WA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
Arduino rocks my socks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I made myself a 8x11 rgb matrix with 3 tlcs and made a new library variant, Tlc5940Mux.  Still alpha, needs documentation, and I'll probably write some more documentation for the main library.

I multiplex 8 rows: all anodes (+) of each led in the row are connected together, and each column goes to a tlc.  All the red leds in the first column go to channel 0 of the first tlc, all the blue leds to channel 0 of the second tlc, and all green columns go to the third tlc.

There's two examples, a Matrix example that displays a diagonal line, and a Serial example that uses 0.5M baud serial (and a python program) to scroll an image ("Arduino Rocks My Socks!!!" in rainbow colors) at 60 fps.  Youtube coming soon when I get a chance to edit the video.
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

acleon, that's quite impressive!  How often are you refreshing the TLC with new data and changing columns?  How much does this affect the LEDs brightness, since they're effectively getting 1/11th as much power sent to them?
Logged

Seattle, WA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
Arduino rocks my socks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It's switching rows every 512us (microseconds), and an update for 3 tlc's takes ~160 us.  I'm using cheap leds from ebay, which are pretty bright.

The image:


What it looks like in the dark behind a piece of paper (the blending between pixels makes it look better when the text scrolls):


Without the paper:


Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Slowly Developing
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First off...I must say that your 8x11 matrix is one beautiful ratsnest of wires. I love seeing stuff like that smiley-wink

Second, this couldn't have come at a more opportune time! I'm currently in the process of building a larger version of Tinkerlog's 64pixels to mount on my newly made satchel/man-purse. But to have a full color matrix rather than one-color...now you're cookin' with gas!

Do you have a schematic for that setup? It looks like you have some transistors in there, as well as some current regulators.
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

I'm kinda new to this electronics stuff and I'm having a bit of an issue. I multiplexed 3 TLC5940 chips like it is done on te arduino playground example. For the IREF used a 560 Ohm resistor. I'm trying to drive 24 groups of 5 RG LEDs (with common anode ofc). So that's 48 times 5 LEDs with 3 TLC's.

The chips are powered by the Arduino. The LEDs are powered with a power supply of 3V and 1.4A. This is a bit low I was told, but I was expecting some result. Yet nothing seems to happen when I run the BasicUse example of the TLC5940 library.

I'm not good with power supply numbers and currents and stuff like that, and for this reason I've already destroyed a batch of TLC chips smiley. Does anybody have any clue what kind of power supply I should use? The schematic once again is the same as the one of the arduino playground, only with 560 Ohms on the IREF. Many thanks in advance!

Jeuv
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 47
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
first, thanks for a great library for the tlc5940!
I had no problems getting it to work with 16 leds and using the basic use sketch.
I want to use it for LEDs which draw more current than what the tlc5940 can handle, and after some research here in the forums I found two solutions, either using a mosfet or a NPN transistor.
I decided to go with the NPN solution.

I hooked up 5 high current leds (3W, drawing 700mA each) on the first five channels, and used normal leds for the rest of the channels.
I used a 10k pull-up resistor for each of the high current channels, each channel connected to a tip122 (through a 1k resistor) which again is connected to the led and a constant current regulator (LM317).
The Iref resistor is 2k (so about 20mA current from the tlc5940).
See the schematic for more details.
http://www.bek.no/~hc/downloads/powerled_schematic.png

As exected the values are reversed so 0 is on and 4095 is off.

I made an extremely simple sketch, first one with only turning on/off channel 0, the first of the high current leds.
The led turned on/off as expected. However, the other channels behaved strangely, going on and off more or less randomly (at least I haven´t found a logic to it yet), often many of them turning on/off at the same time.

When I expanded the sketch to turn on/off all the high current leds in a sequence, they behaved as expected, but again, now and then the other channels behaved strangely.

First I thought the tlc5940 was drawing too much current, but the chip was not hot at all.
Maybe I am missing something obvious in the code?

Code:
#include "Tlc5940.h"

void setup()
{
  Tlc.init();
// I added these two lines to see if it helped, but they didnt make a difference
   Tlc.clear();
   Tlc.update();
}
void loop()
{
  tlcflash(0);
  tlcflash(1);  
  tlcflash(2);  
  tlcflash(3);  
  tlcflash(4);  
}

void tlcflash(int tlc) {
  Tlc.set(tlc, 0);
  Tlc.update();
  delay(1000);
  Tlc.set(tlc, 4095);
  Tlc.update();
}

thanks for any input.

hc

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Incredible work. Interestingly theres a guy on youtube whos basically copied your work (and many others) and is seemingly pretending he created it out of whole cloth. Maybe "developing in parallel" would be more accurate. He didnt appreciate my noting such.

Anyway could you toss the mega8 zip up to the google code site? I went NUTS trying to get the 168 version working on my old ng. I shouldve bought a diecimila heh but the old oscilloscope i just bought (Woot!) just killed that budget. PS i had a problem with the basicuse on ng but the others are great on the mega8

Thanks for all your hard work by the way
Logged

Brooklyn, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 92
Webduino / RGB LED Shield
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just started a new topic at http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1247234344 about the RGB LED shield that's available based on this library.  It's been really great!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi I just downloaded the library to start messing with the TLC5940 chip, only I immediately have this error when I try to compile any of the examples:

"undefined reference to 'TLC' "

The phrase highlighted in the 'basic use' example is "Tlc.clear();" Although other references in other examples are also caught when try to complie or upload to the Arduino.

I'm sure there is prob a simple way to fix this, only I have no experience with code like this, and have no idea of what I would be required to do to 'define' it

EDIT -  its a Macbook, newest Java, the 2009 Arduino and Arduino 0016 for the program, the TLC library was the lates one from Google code

« Last Edit: July 16, 2009, 01:49:18 am by bensaddiction » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im NOt one of the experts here. But ive had every concievable problem with this setup (Mostly because i was using an arduino ng with atmega8 at first. Requires different hardware/software setup)

Delve into the downloaded file. You need to move the Tlc5940 library folder to the arduino libraries folder amongst other things. If you have more  than one tlc5940 you need to define that in tlcconfig.h i believe etc.
Logged

Pages: 1 ... 12 13 [14] 15 16 ... 18   Go Up
Jump to: