SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Barx
#112160
Hi chaps, the local n00b here.

Going to be playing with my new 8 x 8 bi-colour LED Matrix. I've looked into ways used to multiplex the LED's and some people use shift registers like the '595'. Others use Multiplexers/Demultiplexers like the 4051. I've been trying to think which would be best. I thought the 4051 as it can mux analog signals. But, I have today read that this can also be achieved with the 595 too by tweaking the OE pin (I'm guessing this is with PWM). Is this usuable to the extent that you could vary the brightness of each LED individually? Seems like it would take some decetn code to do that. To me, the 4051 seems easier. Set your x, y and analog out for brightness and zap it out, move onto next LED. Only problem I could see here is a speed 1. As each LED would be addressed individually within loop. Were as my believing is that with shift registers you can address a row at a time.

One other thought I had was a shifter to address rows. Just a simple 00000001, 00000010, 00000100, etc. And then a mux to address column. But as I write this I've just thought. My 8 x 8 is common anode so would it be the anode voltage that needs to be varied or would it still work on the cathode but opposite way round. 255 = off, 0 = on.

1 last thing seems though its a long post, How do you calc your resistors for these matrices? do you calc with a single LEDs' current as your only turning 1 on at a time, or a full row as they will all be 'visually' lit at once? First I thought put resistors in Anode to use less. But the currents of red and green are slightly different so 1 may be dimmer than others. So, it may be better to put them in cathode. 1 val for red, another for green. I've many projects were no resistors are used with arduinos, how does this work. Or are they just hiding. lol

Sorry for another long post. I get carried away and have soooo many questions.

Thanks
By n1ist
#112246
The last matrix I did was monochrome, but the same technique would work with color. I used the micro's IO to drive the anodes through some PMOS FETs, and used a TPIC6B595 (a '595 family shift register with power open-drain FETs on the outputs) to drive the cathodes. I would have only one output of the '595 active at a time.

For PWM, you can do it in software by having an 8-bit counter and only turning on an LED when its brightness is less than the current count value. Doing PWM with the ~OE pin would only let you set the whole panel to one intensity.

For an RG or RGB panel, you will want to use different resistors for each color, or use a constant-current sink chip. The TLC5916/TLC5917 works nicely for this.

/mike