LED Matrix hardware help please.
Jed
Posts: 107
I'm going to mess around with an 8x8 LED dot matrix. Specifically this one
Ok, so I need some clarification on a few things. First, an LED dot matrix such as this one is not purely common-cathode, nor common-anode. It's both correct? Column is one and row is the other. I see some advertised as common cathode, which doesn't make sense to me. Someone please explain if I'm wrong.
Second, I'm trying to decide between a max7219, or a tlc5940. Not sure which one to use. I understand how the max7219 works. 8 channels source, and 8 channels sink. But if I understand correctly, the tlc5940 sinks all 16 channels, so I'm not sure how that could be used with a dot matrix? I'd prefer the TLC as it's half the cost.
Ok, so I need some clarification on a few things. First, an LED dot matrix such as this one is not purely common-cathode, nor common-anode. It's both correct? Column is one and row is the other. I see some advertised as common cathode, which doesn't make sense to me. Someone please explain if I'm wrong.
Second, I'm trying to decide between a max7219, or a tlc5940. Not sure which one to use. I understand how the max7219 works. 8 channels source, and 8 channels sink. But if I understand correctly, the tlc5940 sinks all 16 channels, so I'm not sure how that could be used with a dot matrix? I'd prefer the TLC as it's half the cost.
Comments
The TLC5940 will not work with that LED matrix as you suspected since it is a common anode driver IC.
A single MAX7219 will drive the 8X8 matrix multiplexed no problem.
Post Edited (Jed) : 2/13/2009 7:42:23 PM GMT
ive used these 595's before, i know it is low to ground, so a bipolar matrix may give you problems, however you might be able to use a 595 and 8 pins to alow you to use input to give you a low state.
Ok, now help me out with the math here, because I'm new at all this. [noparse];)[/noparse] Let's assume I'm only worried about 1 color for now.
If each channel of the 595 is rated up to 20mA, and I'm using 2 of them to control an 8x8 matrix (one controlling cathode, one controlling anodes), that means I have to do 1 of 2 things:
1) Pulse each led in the matrix individually and use a 150ohm resistor on each row, or
2) Pulse one row at a time, but limit the current for each LED to 2.5mA, using 1.2k resistors on each row.
(to figure the resistors, I use ohms law, but subtract the LED's forward voltage from the voltage source first, correct?)
The stamp may not have enough speed for #1 without a flicker?
#2 will cost me brightness, and I'll also have to adjust my pulse time per row depending on how many LEDs in that row are lighting so that brightness across the entire matrix looks uniform. Again, maybe a speed issue with the stamp updating the 595?
Post Edited (Jed) : 2/16/2009 5:45:48 PM GMT
driver A controls 4 cathode rows and 8 anode rows (red/green on each)
driver B controls 4 cathode rows and 8 anode rows (ditto)
Remember that the 7219/7221 has a scan digit setting -- really a scan cathode row setting -- which tells it how many cathode rows/digits to multiplex before going back to 0. If you set each driver to scan 4 digits, then you're set. The only thing you'll need to decide is how to wire/handle your red green. You could do evens/odds in each byte, or you could set it up so that all greens are on rows 0..3 and all reds on rows 4...7 -- virtually speaking -- in other words, the rows/segments from the driver, not the physical layout of your LEDs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
so for instance if you wanted to make a diagonal line, you would pulse out the data to light the first led, hold for a few ms and then write the next led out, keep sucessivly doing this only a few ms and so long as you can keep the pattern within 30 ms, which is the limit of human eyesite, you wouldnt see much of a difference.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Zoot: Already over my head here. What's a transistor driver and why would I need it? Does it have something to do with all the forward voltage's of the LED's adding up in the rows? I understand the resistor part and I'm ok with wiring those up individually.
Basically I'm just looking for the cheapest way possible to do a 8x80 dot matrix, preferable with the basic stamp. I don't mind extra programming requirements, nor extra wiring requirements.
BTW, thank you for all the help, and putting up with my noobishness. [noparse];)[/noparse]
The solution is to:
a) use a transistor on the Stamp pin to drive the whole column (individual segments will each pull < 20ma so the segment pins would be OK). That's 8 transistors + 8 base resistors minimum, plus a resistor of 100-220ohms on each LED. You can also use a single IC package driver like a ULN2803 which is like having 8 NPN transistor darlington arrays in one single (cheap!) IC.
or
b) use individual segment/led resistors that are higher in value (and hence dimmer LEDs) so that you limit the total possible current on the row/digit.
or
c) code your project so that you don't light too many LEDs on a given row/digit at any one time.
or
d) use a driver like a MAX62xx or MAX72xx
All of these are good solutions depending on what you want. I often limit LED output and simplify circuitry, but sometimes you just want those LEDs hot and bright. I usually use an SX and sink drivers like the ULN2803 because I have them on hand and they are cheap. That's also nice for individual PWM of leds/segments. In other cases it's infinitely easier to use a driver like the MAX7221 -- the external circuitry is practically zero, the multiplexing is *very* fast -- 800hz across the whole matrix, and having a single iset (currernt limiting) resistor is nice because you can use a pot if you want to have a nice brightness control (and if the driver has a little air circulation, you can run your LEDs *very* bright and the chip doesn't get too warm).
T&E Engineer builds his big matrixes with NPN transistors for each column and PNP for each row (or maybe the other way around ) so current is not an issue.
Remember that the Stamp will be relatively slow... you may be able to do the multiplexing if your program is not doing too much else and/or if you consistently run a "gosub refresh" routine (sprinkled through your main loop) to keep the display multiplexing moving even while the main loop is cranking through other things... e.g.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 2/17/2009 8:51:19 PM GMT