Red LED matrix with TLC5940

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! :frowning:

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 (Google Code Archive - Long-term storage for Google Code Project Hosting.), the following code would do the same effect as when using digitalWrite() in the first attempt:

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

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

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

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.

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. :frowning:
I'll check for ordering it, but with shipping to France, it might get quite expensive... anyway... :slight_smile:

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

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.

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

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

You can get them cheap on eBay...

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

One last question, the MAX7219 description on the website you gave me says "Common Cathode serially interfaced display driver".
(MAX7219 7 Segment + Dot Point, Common Cathode serially interfaced display driver PDIP-24)

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

Thanks,
Michael

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

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.

ok, thanks again!! :slight_smile: