Pages: [1]   Go Down
Author Topic: Red LED matrix with TLC5940  (Read 789 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm just starting playing with a 8x8 red led matrix that I got, my first attempt was somehow successful, but was using all my arduino pins.
So I'm now trying to use a TLC5940 to control the matrix and keep some pins free on the arduino... But it doesn't work! smiley-sad

For the first attempt (without TLC5940), I've just followed the RowColumnScanning tutorial (http://arduino.cc/en/Tutorial/RowColumnScanning), got it working fast, I just add to revert column 4 and column 6 pins, to adapt to my matrix. (I don't have the datasheet of my matrix...), then setting first row to HIGH and first column to LOW was actually lighting my first LED.

Then, moving to TLC5940, I didn't found any simple project example to drive such a simple "one color matrix", but my idea was to use the 8 first outputs of the TLC5940 to set COLUMN values, and the 8 last outputs to set ROWS values in order to be able to control each LED individually. I thought that, using the TCL5940 library form here (http://code.google.com/p/tlc5940arduino/), the following code would do the same effect as when using digitalWrite() in the first attempt:

Code:
Tlc.set(0, 0); // channel 0 is COL1
Tlc.set(8, 4095); // channel 8 is ROW1
Tlc.update();

=> it doesn't work

BUt I I put +5V directly on ROW1, and do Tlc.set(0, 4095), I get the light on first LED...

So I think I've not understood how it should work with the TLC5940....

Is it correct to think that I can control ROWS and COLUMNS with the 16 outputs of the TLC5940?
Then is it supposed to work using the .set() function, as when I was using the digitalWrite with arduino's outputs?

Does anyone as an example of such project?

Thanks a lot!
Cheers,
Michael

Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you might be confusing the TLC5940 with the MAX7219.

The TLC5940 can't output current on any of its pins.
Logged

No, I don't answer questions sent in private messages...

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23793
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

TLC5940 sinks current on all outputs at individually commanded PWM levels.
The way a matrix works is that you drive the anodes, sink one column, drive the anodes, sink the next column, etc., and persistance of vision gives the illusion of all LEDs being driven together.
Can't really do that when you have 16 outputs all sinking current at their commanded PWM rates.
For a matrix, use a part like MAX7219, $1.25 from Taydaelectronics.com, inexpensize shipping as well.
Takes care of the multiplexing for you, so all you need to do is write to 1 of 8 registers to update a column of data as needed.
Brightness of the entire display is controllable also.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Hi,

Thanks for you answers! I'm quite disappointed though, I thought it would work with the TLC as I saw several LED projects using it, but seems not as easy as with the MAX7219, which I didn't find at my local store. smiley-sad
I'll check for ordering it, but with shipping to France, it might get quite expensive... anyway... smiley

So with you comments, I got something more or less working by plugging the ROWS to arduino's outputs, and the COLUMNS to the TLC, but it's a bit awkward to use...

Let's go for the MAX7219!

Thanks a lot,
Michael
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23793
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Shipping to the US is not expensive, let us know the charges to France. I usually buy other stuff too, plan ahead for future projects or just to have parts on hand to experiment with.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4554
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for you answers! I'm quite disappointed though, I thought it would work with the TLC as I saw several LED projects using it

It's not commonly used for matrices.

, but seems not as easy as with the MAX7219, which I didn't find at my local store. smiley-sad
I'll check for ordering it, but with shipping to France, it might get quite expensive... anyway... smiley

You can get them cheap on eBay...

Logged

No, I don't answer questions sent in private messages...

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

ok, I'll let you know for shipping price to France. smiley

One last question, the MAX7219 description on the website you gave me says "Common Cathode serially interfaced display driver".
(http://www.taydaelectronics.com/max7219-7-segment-dot-point-common-cathode-serially-interfaced-display-driver-pdip-24.html)

But I think the matrix is a common-anode one. (not sure though).
Will it work anyway?

Thanks,
Michael
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23793
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, you just need to orient your display a little differently. For example, look at these two devices:

http://www.futurlec.com/LED/LEDMS88WH-CA.shtml
http://www.futurlec.com/LED/LEDMS88WH-CC.shtml

So if you take one, turn it 90 degrees, you can see that both can have anodes that can be driven as rows, and cathodes that can sink an entire column at once.
The Upper left diode may need different pins to turn it on, pins 9/16 for the left matrix and pins 8/9 for the right, but a little thinking and keeping the wiring straight will allow accurate control of the columns.


* CommonCathode_vs_CommonAnode.jpg (80.57 KB, 960x720 - viewed 35 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

ok, thanks again!! smiley
Logged

Pages: [1]   Go Up
Jump to: