Shop OBEX P1 Docs P2 Docs Learn Events
5 x 7 LED array question — Parallax Forums

5 x 7 LED array question

egenrietheregenriether Posts: 29
edited 2012-04-17 15:09 in Propeller 1
Hello,
I am trying to drive a 5x7 LED array with a prop chip with no driver/interface module. In other words I am using the 3.3V of an output pin at about 20mA using a current limiting resistor. This works fine, but I am having a problem with sinking the current. In case you're not familiar, the array uses an X-Y select for its 12 pins. That means to turn on a single LED, you make the column that LED is located in "high" and the row its located in "low". If you simply ground the row they're on (i.e. low) the whole row lights up. So I thought I could make the low (current sink) an input pin, using the dira[PIN] :=0 commands but I can't get it to work this way. The led blinks fine when I physically ground the cathode using the ground ports on my PPDB but I can't get a pin to let me sink current into it. Before I post the bit of code I have I want to know if this is even possible. I can't see why it wouldn't be.
Thanks

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-16 19:53
    It is possible to drive a 5x7 array and much larger without a driver chip. Take a look at this thread where I described one way to do it.

    http://forums.parallax.com/showthread.php?136152-LED-Marquee-Module-for-Gadget-Gangster-Platform-%28w-video%29&highlight=rgb+matrix

    Let me know if you have any questions.
  • jmgjmg Posts: 15,183
    edited 2012-04-16 20:01
    It is possible, but barely practical.

    In a Matrix the weak link is the common sharing, in your case 7 dots have to share the current budget of 20mA, so that is ~ 3mA per dot.
    Now you also still have to multiplex 5:1 so you are down to a average dot current of ~600uA

    If you have pins to burn, you can parallel pins, but usually external drivers are chosen.
    If you budget 20mA one way, and sink 7x that, you need 140mA sink, and now your Dot current is an average of 4mA.

    Peak Chip current is 140mA, so check the specs. I see they mention 300mA package limit, and 40mA pin limit
  • kwinnkwinn Posts: 8,697
    edited 2012-04-16 20:05
    You need to make both the source and sink pins outputs. The source pin connects the led to +3.3V and the sink pin connects it to ground. When you make a pin an input it has a very high impedance (resistance) and sources or sinks almost no current.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-16 20:27
    Jmg, the trick is to only light up a few LED's at a time and sweep through the matrix quickly. The persistence of vision does the rest. In my marquee I turned on 4 at a time and swept through the entire matrix quickly.
  • kwinnkwinn Posts: 8,697
    edited 2012-04-16 20:35
    Martin, I think you may have missed this sentence in his first post.
    So I thought I could make the low (current sink) an input pin, using the dira[PIN] :=0 commands but I can't get it to work this way.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-16 20:42
    Yeah I didn't see that, but I figured a working example would help him figure out how to do what he wants.
  • jmgjmg Posts: 15,183
    edited 2012-04-16 21:09
    Martin_H wrote: »
    Jmg, the trick is to only light up a few LED's at a time and sweep through the matrix quickly. The persistence of vision does the rest. In my marquee I turned on 4 at a time and swept through the entire matrix quickly.

    Yes, but the average current value issue still remains.
    Very new, high bright LEDs could work indoors, but older matrix displays tend to have feeble LEDs.
  • egenrietheregenriether Posts: 29
    edited 2012-04-17 00:47
    Hey guys, thanks for all of the replies. I should have stated that I do plan on a multiplexing scheme where I will only have one LED on at a time. I had a total brain lapse on the high z state of an input pin, thanks for reminding me kwinn. Its late here so I will have to try it tomorrow, but I thought when I was working on it earlier I had set all pins to outputs and tried it that way too, but I'll try again. Martin_H your display is awesome! Display-wise, my gadget will be simpler but I'll post a video anyways when its done. Thanks, I'll keep you all posted.
  • egenrietheregenriether Posts: 29
    edited 2012-04-17 11:33
    Ok, it looks like that was my problem, setting the pin as an output. Now once I have the entire display wired to the pins I will be able to keep certain LEDs off by setting their return-path pins as inputs, since the anodes will have voltage whenever one of the others in its column does.
  • HShankoHShanko Posts: 402
    edited 2012-04-17 14:21
    egenriether. You probably don't even have to change I/O direction. Just put (mask) the pins Low for the OFF LEDs and the High state takes care of the ON LEDs. This assumes Common Cathode array.

    I've had success with them before. Only i used low voltage FETs to drive the common cathode LOW; to let the FET carry the current, not the micro controller I/Os (that was using a PIC years back. I let it scan about 80 times/sec for SIX 5 x 7 LEDs. No flicker as a low scan time would show.
  • codevipercodeviper Posts: 208
    edited 2012-04-17 15:09
    I recommend using transistors or a buffer or a 3 to 8 line decoder.
    the last option will result in less pins consumed.
    i have a project i did with a 2 to 4 line decoder connected to 2 pins and then 4 pins to drive LEDs ( i was using an atmega sorry)
    in your case adding the 3 to 8 line decoder can reduce pin use from 13 to 8 (if the 7 rows share the cathode)
    I say do this as the 3 to 8 line chips are 40 cent but its a big advantage over say using 13 pins.
Sign In or Register to comment.