Please help! Bicolor LEDs and MAX7219
bytor95
Posts: 53
Hi,
This one is killing me and I can't figure out what it is for weeks now.
I'm using the Max7219 LED driver trying to get bicolor LEDS to display red or green. I can't for the life of me figure out what I'm doing wrong but I can't make the driver change the color state. I did have success with using a bicolor 8x8 matrix though with the MAX7219. Actually, it worked so well I thought it would be simple to change over to discreet LED's. Has anyone been successful doing what I'm trying to do?
Here is one of the LED's I tried. I tried many others too: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=230143471065
Thanks in advance,
Engin
This one is killing me and I can't figure out what it is for weeks now.
I'm using the Max7219 LED driver trying to get bicolor LEDS to display red or green. I can't for the life of me figure out what I'm doing wrong but I can't make the driver change the color state. I did have success with using a bicolor 8x8 matrix though with the MAX7219. Actually, it worked so well I thought it would be simple to change over to discreet LED's. Has anyone been successful doing what I'm trying to do?
Here is one of the LED's I tried. I tried many others too: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=230143471065
Thanks in advance,
Engin
Comments
Bi color LED's are pretty simple when you get down to it: one lead from it is the ground, but there are three. power one of the others and viola one color. but what if you want another color too? That's right, power down that one and power the other one. this should help you:
A quick example:
and that should work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Mega
Want to know how to build your own robot?
www.societyofrobots.com
Need good forums for things other than programming?
http://www.societyofrobots.com/robotforum/index.php
Post Edited (Megaman935) : 7/23/2007 3:29:31 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Mega
Want to know how to build your own robot?
www.societyofrobots.com
Need good forums for things other than programming?
http://www.societyofrobots.com/robotforum/index.php
Post Edited (Megaman935) : 7/23/2007 3:29:40 PM GMT
Engin
Engin
Engin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Mega
Want to know how to build your own robot?
www.societyofrobots.com
Need good forums for things other than programming?
http://www.societyofrobots.com/robotforum/index.php
I need the max because I'm trying to drive 32 bicolor LEDS. Thanks.
Engin
Red lead --> digit 0, segment A
Green lead --> digit 0, segment B
Then, writing the following to digit 0 should give you these colors:
%00000000 --> off
%00000001 --> red
%00000010 --> green
%00000011 --> yellowish
This also gives you the start of schema for driving all 32 LEDs... with each pair of segments (A-B, C-D, etc) being an LED. After each 4 LEDs you'd need to work with the next digit.
Does this help?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Well I hope this helps...
I have been doing some testing with the MAX7219 on my own project and what I found was if you get a two lead bi-color LED and connect the digit lead to one end and a segment lead to the other you can switch between the two colors without any problem.
The LED I used was a LINROSE B4301H1/5 LI
T1 3/4-2 LEAD- RED/GREEN LED w/ clear lens cap clip.
I got it at Fry's.
Joe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“Intellectual growth should commence at birth and cease only at death”
Albert Einstein
Post Edited (kingspud) : 7/25/2007 12:45:25 AM GMT
If you have an 8x8 LED matrix then you have 2 color sets (or really 3) of 64 LEDs not 32.
You may have seen·that I have built a tri colored clock with an SX52 (or SX48 is possible) and 4 of these 8x8 displays. Check out the Youtube video in this link:
http://forums.parallax.com/showthread.php?p=649643
It's been running for weeks now with no problem switching between the green, red (and yellow combination)·LEDs.
If you see the·3rd drawing it shows that I am using·74HC573's to control the LED colors.·It should be easily adapted for your needs with the BS2, MAX7219s and LED Matrixs. The outputs of the MAX7219 chips·can go into the inputs of the 74HC573's and then the·2 /OE lines can be controlled with 2 lines·of the BS2 to set the conditions (00,01,10,11) that Zoot stated. ·You should not need ULN2803's on the outputs of the 74HC573's either (connect directly to the LED Matrix). You do not need 4 74HC573's either. My SX52 controlled 4 8x8 LED Matrixs (16x16).
Although I have not been able to figure out how to use an SX chip with a MAX7219 yet, I have been able to cascade 2 or more together using a Basic Stamp 2 (as you know).
http://forums.parallax.com/showthread.php?p=636061
I am using the 8x8 LED matrixes here as seen in the pictures.
I will try to put it together over the next couple days and post some pics and schematics if you like.
I love how you can learn something and then apply it to your future projects!
Post Edited (T&E Engineer) : 7/25/2007 10:13:40 AM GMT
Thanks for all the amazing replies. You guys got me thinking in many different directions.
I found out what I'm doing wrong. I bought these LED's
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=230143471065
Notice that it says "common cathode". So I figured that hooking up that common lead to the segment leads of the MAX7219 would do the trick. The two other leads, red and green, of the LED I thought would go to DIG0 and DIG1.
This is how I had hooked up my 8x8 bicolor LED matrix.
I got the LED's to work by hooking up DIG0 to the common lead of the LED and hooked up SEGA to green and SEGB to red. Works perfectly.
My question is why does it work opposite to the 8x8 matrix. Both of them are labeled (common cathode).
Thanks in advance,
Engin
I use the standard P0-P2 for the MAX7219 and P3 and P4 to control the /OE lines on each of the 74HC573 ICs. The inputs on both of the 74HC573 ICs are tied together and run back to the MAX7219. The 8 outputs of the 1st 74HC573 go to the 8 Red LED Matrix cathode lines and the 8 outputs of the 2nd 74HC573 go to the 8 Green LED Matrix cathode lines. Both LE lines are tied high and of course don't forget about Vcc and Ground on the 74HC573 ICs.
I have attached my BS2·code which is modified from Jon Williams Nuts and Volts #70 program on the MAX7219.
The code first flashes on the letters B then S then 2. It then scrolls across the letters P a r a l l a x·· B S 2. This happens 3 times.
But here is the catch...
It first time the letters are in RED, 2nd in Green and last time in Yellow. It then repeats itself.
It also doesn't look hard to create individual colored letters if first set up in the code.
If anyone is interested any further, I will come up with a full schematic and pictures or YouTube video. Otherwise...here is my contribution to the problem.
Engin
Here's a quote from maxim
Eight-Digit Drive Lines that sink current from the display common cathode. The MAX7219 pulls
the digit outputs to V+ when turned off. The MAX7221’s digit drivers are high-impedance when
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
However, if you wanted individual control of every LED in hardware control (not sure how to do it within the MAX7219 if at all possible), you would need to be using ICs with 8 individual /OE lines or latch lines. This would require·much more I/O lines available for use on the BS2. You would first need the original 3 for control (DIN, CLK, LOAD) from the MAX7219 into the BS2 (P0-P2). Then you would need at least 8 (possibly 16) more output lines on the BS2 for /OE control of each LED. I don't know what this IC number would be for individual /OE control of each input. Most if not all of the latch chips I know of are 3 state and you would need 8 control lines for the 8 lines of data passing through.
I suppose a (8) 2 input AND gates·might work too like 74HC08 ICs. Since they come 4 AND gates to an IC·you would need 2·ICs for 8 pass through lines and the 2nd input line to each AND gate could be sent high or low to control the data being passed through the AND gate.
However, in my design via simple code writing you could lets say make the first letter scrolling "green" and then the next letter "red" and so on using some IF THEN statements to control the color /OE lines.
Let me know if you would like me to create an schematics / pics if interested.