Shop OBEX P1 Docs P2 Docs Learn Events
Charlieplexing a 8x8 LED Matrix ? (How Do I) — Parallax Forums

Charlieplexing a 8x8 LED Matrix ? (How Do I)

Areal PersonAreal Person Posts: 197
edited 2007-08-15 16:26 in Propeller 1
Hi,
·
How is everyone doing ?
·
QUESTION #1
·
It’s my understanding that I can use 16 pins of a Propeller to
drive 8 columns and 8 rows of standard 5mm LEDs at 3.3 vdc
(Only one LED would be on at any given time).
·
Is this true ?
·
QUESTION #2
·
Can I use Charlieplexing to reduce the number of pins required to drive
the same number of LEDs ?
·
If so, Could someone please help me figure out a simple schematic diagram
for Charlieplexing a standard group of 8x8 LEDs that are in a row & column
configuration ? I want to use a propeller chip to do this, but I need some help.
I’ve read documents on Charlieplexing, but I don’t understand how to do the
Charlieplexing wiring diagram for a simple 8x8 led matrix.
·
Here’s the wiki on Charlieplexing.
http://en.wikipedia.org/wiki/Charlieplexing

Maybe someone knows of a good url that will show me how to do it ?
·
Thanks for all the help,
-Areal

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but

what do you expect ? I'm a programmer.

Comments

  • Areal PersonAreal Person Posts: 197
    edited 2007-08-13 19:47
    It's my understanding that using Charlieplexing I can do the following...

    Drive N * (N - 1) LEDs, so for 32 I/O pins thats...

    32 * (32 - 1) = 32 * 31 = 992 LEDs....wow!

    Is that right ?

    And how would I calculate the max fixed frequency·so I can determine
    the ratio of the ON time to the total pulse time to better understand how my Duty Cycles
    will function ?

    Remember, I'm a total newbe

    Thanks,

    -Areal

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a tree growing out of my head, but

    what do you expect ? I'm a programmer.

    Post Edited (Areal Person) : 8/13/2007 7:58:31 PM GMT
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-08-13 21:43
    I had never heard of charlieplexing before, looks very useful but I think if you have 992 leds they may be 992 very dim leds as if all leds are on they are each on only 1/992 of the time, that's 0.1% duty.

    Question one, yes and one at a time.

    Question two, www.maxim-ic.com/appnotes.cfm/appnote_number/1880 the fact that these are segmented makes no difference they are just 8 leds with a common cathode. You just need to treat each row of your 8X8 as one of these segmented displays by commoning their cathodes.

    Graham
  • BTXBTX Posts: 674
    edited 2007-08-14 00:16
    Hi Areal.

    What are you thinking in use this method for ?

    If it is, about your LED screen idea....forget it.nono.gif
    I think, this method is intended to be used with "segments displays" only... and such a quantity of leds that you name, will not have any bright at all.
    You would need a very high current pulse to do that (impossible for leds)... and a very high multiplexing frequency... that is not viable (my opinion)smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-14 01:51
    Don't underestimate modern LED technology smile.gif Some people live happily with "low current" LEDs, with a brightness of 1 to 2 mcd @ 2mA. Some ultra bright LEDs for 20 cents (3 mm, less expensive in SMD) now sport 2.000 mcd, and they work fine with low current, though I have not yet tried 30 uA, but will tomorrow ...


    BTW: I think everyone of us has used "Two-wire-Charlieplexing" at least once in his electronic life - but not beeing aware of its name and its potentiallities...

    Post Edited (deSilva) : 8/14/2007 1:59:39 AM GMT
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-08-14 02:55
    Hi Areal,

    To do what you say you want to do, you would need at least 9 pins.

    1st row: connect pin 0 to all cathodes and pins 1-8 to anodes of each LED
    2nd row: connect pin 1 to all cathodes and pins 0 and 2-8 to the anodes
    3rd row: connect pin 2 to all cathodes and pins 0-1 and 3-8 to the anodes

    You should see the pattern now.

    for your software:

    1st row: bring 0 low, bring all others high, and set DDR for output for the anodes corresponding to the LEDs you want lit
    2nd row: bring 1 low, bring all others high, with DDR set for output on the ones you want lit

    again...you should see the pattern

    Hope this helps.

    Ken

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ----


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • BTXBTX Posts: 674
    edited 2007-08-14 03:12
    Although modern LEDs can have a better performance than the old ones, and even you could have a good bright with a very low current.

    I continue thinking, that with such·short pulse needed to multiplex 992 LEDs, it is not possible to get some bright, without draining a significant curent through them (in that short time), I think it is the same as have a PWM signal driving one LED, with a "almost zero" duty cycle for each of them.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • LawsonLawson Posts: 870
    edited 2007-08-14 06:02
    Looking at the Maxim app-note this multiplexing scheme doesn't seem to have any worse of a duty cycle than a standard N*N grid. It simply takes advantage of the LED's properties to multi-multiplex the pins. (I could see this working as a key scan matrix IF a diode was included in series with each key) So scaling to 32*31 the max duty cycle of an LED would be 1/32. (still dang low)

    DI217Fig03.gif
    DI217Fig04.gif

    these two pictures from the Maxim app-note show the detailed current flow as each digit is illuminated. Looks like all eight elements of a digit can be lit at once. The software to drive it would be interesting though.

    Edit: Looks like a fairly fancy output driver is needed on the driving chip for optimal performance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?

    Post Edited (Lawson) : 8/14/2007 6:13:41 AM GMT
  • OakGraphicsOakGraphics Posts: 202
    edited 2007-08-14 06:42
    I dont think brightness would be a big issue here.

    Looking at the links, I noticed some guys selling kits based on this principle.· They hooked up 19 Bright Blue LEDS, 1 IR LED, a button, and 1 IR Reciever to an 8-pin pic.

    http://www.2dkits.com/zencart/index.php?main_page=product_info&cPath=1&products_id=6

    Here is an animation of the 'blinky' running one of it's patterns.

    pattern6.gif

    Here is the schematic for thier circuit:
    http://www.2dkits.com/kits/19stick/19stick.pdf
  • GadgetmanGadgetman Posts: 2,436
    edited 2007-08-14 08:27
    you want to save pins?

    Get a proper LED driver IC instead.

    http://para.maxim-ic.com/cache/en/results/39553.html

    Lots of ICs that works well on 3.3V...
    They even have watchdog and LED-fault detection.
    (Some have PWM brightness or daisy-chaining, too)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-08-14 09:37
    Lawson, Oakgraphics,

    Read post number 2, he is talking about 992 leds and it doesn't matter if they are charlieplexed or multiplexed they would be on for 0.1% of the time.

    Graham
  • big_markbig_mark Posts: 49
    edited 2007-08-14 09:47
    I'm currently using some Texas TLC5940 LED drivers. Datasheet here

    It gives 16 channels of 12-bit PWM dimming, with dot correction if you need it, and it has a current limit of upto 120mA per channel. It will run on 3.3 or 5 volts and only uses 5 data lines plus 2 or 3 power lines (depends on wether you are using separate logic and LED power sources). The only other components you'll need are a 100nF decoupling capacitor and a current-limiting resistor.

    Edit : I'm currently using BTXs code (thanks for that) to test my setup.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-08-14 12:29
    Sorry guys,

    I guess I didn't see the 32 x 32 part.· I thought Areal was talking about 8 x 8.· Perhaps you can use latches for your columns and decoders for your rows.· You can even put decoders on your latches to reduce required pin count on the propeller.· I would take Gadgetman's advice and research what kind of drivers you can find too.

    Ken

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ----


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-08-14 15:28
    Take a look at the LC7932 LED driver (attached) that the AD-501-B 16x32 LED display board. I have already written code for this for the BS2 and SX-28.

    http://forums.parallax.com/showthread.php?p=651690

    http://forums.parallax.com/showthread.php?p=658966
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-14 17:20
    So, done my checks: The LEDs work fine @ 50 uA i.e. you cannot multiplex 900 of them, but around 600. Not very bright, but acceptable.

    I am always astonished, that people try to use some fancy MSI chips for things the Prop can easily do by himself (or at least with a little help from some 74HC595 for 20 cents)

    To my puristic opinion, there should be nothing connected to a Prop but resistors and caps smile.gif
    But we Germans have also funny attitudes wrt to beer...

    Post Edited (deSilva) : 8/14/2007 8:34:34 PM GMT
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-08-15 12:21
    600 leds but that is just on off control, if they are already dim there will not be much milage in pwm assuming you could anyway. So perhaps the odd external chip might be allowed in those cases.
  • Areal PersonAreal Person Posts: 197
    edited 2007-08-15 15:27
    Hi,

    I want to say thanks to everyone for all the help !!

    I've been working with a LM317 as a current regulator and I've tested a single 3.8 fV
    LED successfully with 12vdc if I use a 410ohm resistor. I'm not sure how high I can raise the voltage.

    I think Thats...
    I=(1.25 / 410ohm = 0.01)

    Because of everyones help, I think I will be successful with this project (even if I do haft to change some things around).
    I'll post some pictures real soon of my progress.

    Actualy, I'm working on a 12x12inch PCB that holds 768 led's (19mm dot pitch)
    I'm going to use the propeller proto board for the controller.

    I just thought...

    1) if I could regulate the current and raise the voltage high enough for PWM & duty cycle of 768 led's
    2) and if I could use Charlieplexing to reduce the amount of required pins that
    I would be able to drive a 12x12 inch RGB led panel with just the propeller
    chip, using PWM and duty cycles, I know that may be pushing it.

    But...
    Can the propeller do it ?

    I love my propeller chip !

    Thanks,
    -Areal

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a tree growing out of my head, but

    what do you expect ? I'm a programmer.
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-15 15:35
    It depends: lets take 20x20 = 400.
    (1) we can provide nearly 40 mA according to the newest datasheet = 100 uA per LED.
    The LEDs are assumed to shine with 2.000 mcd @ 20 mA, which means 10 mcd @ 100uA , thats nearly bright smile.gif
    A refresh of 100 Hz will suffice, thus we need a 40 mA pulse of 10 us. But there is a not negligeable capacitance to drive! A gross calculation (400 x 5 pF x 100 Ohm = 200 ns) however shows it's not yet in the order of a lowpass nuissance.

    (2) But we can do much better! We can choose a refresh scheme lighting LEDs in more than one "row" at the same time! This needs some calculations, as we have to omit the LEDs the "other" pin of which are needed for another LED to shine,
    and come back to them later:

    (3) A similiar but much easier scheme will allow you to shine the display with always the same brightness of "one super bright LED equivalent": You have just to sort out the LEDS to shine and cycle through them. This is no advantage when half of the display or more is on anyway...
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-08-15 16:16
    Areal, if you want to "give it to them" then you could use some form of amplifier, regulation could just be resistors (I'm not sure how fast a regulator would be). For short pulses you can put much more current through the leds to get more power out for the short on time.

    DeSilva, I don't understand your 3)

    Graham
  • deSilvadeSilva Posts: 2,967
    edited 2007-08-15 16:26
    @Graham: Well, this is a small "home brew" video, but we need not stick to video rules smile.gif So if we Know we have to shine LED 1, 4, 301, and 320, we kann can do it in that order, changing the "pixel clock" from 100Hz*400 to 100Hz*4, i.e. stretching the "duty" from 10us to 1 ms. And be careful with just one LED on smile.gif
Sign In or Register to comment.