Shop OBEX P1 Docs P2 Docs Learn Events
8 x 8 LED Matrix Help Needed — Parallax Forums

8 x 8 LED Matrix Help Needed

NWCCTVNWCCTV Posts: 3,629
edited 2014-04-20 18:03 in General Discussion
I just received my Sunfounder Raspberry Pi accessory kit and it has an 8 x 8 LED Matrix that I have no clue how to wire up. So, I bring my question before the experts!!!! I think I want to try and get it going with my Prop BOE first. Once I get that figured out I can move on to figuring it out for the Raspberry Pi. Has anyone connected one of these to either a Stamp or a Prop, or a Pi for that matter?

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-04-18 18:48
    Pretty simple to hook up but he data sheet shows both a common anode and common cathode. Need to know which one you have, and what do you have in the way of drivers, shift registers and/or transistors.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-04-18 19:17
    Forgive me for being brain dead right now, how do I tell if it is CA or CC?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-18 19:24
    If you keep the current low enough (about 3mA per LED), you could drive the arrays directly with the Propeller but You'd use up 16 pins to do so. You'll probably want to use either a '595 type shift register or a MAX7219 chip to control the LEDs.

    There's some discussion about these type of LEDs in this thread.

    I posted some code to control MAX7219 chips in this thread.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-18 19:30
    NWCCTV wrote: »
    Forgive me for being brain dead right now, how do I tell if it is CA or CC?

    Using a 100 ohm resistor to limit the current connect 3.3V (through the resistor) to pin 5. Connect pin 1 to ground. If the corner LED lights up it's common cathode. If not, switch the power and ground connections and test. If it lights up this way it's common anode.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-04-18 19:38
    Hi NWCCTV
    NWCCTV wrote: »
    Forgive me for being brain dead right now, how do I tell if it is CA or CC?
    As a test to get to know the part:
    Use the 3.3V Prop power supply.
    Use a small resistor of about 500Ω connected to +3.3V. 330Ω to 1KΩ would work OK.
    And a wire to 0V.
    Apply this to the pins and see if each LED lights up.

    The resistor will ensure no damage to the part will occur.
    The current will be around 4mA but the actual value will be dependent on the color.

    Have Fun.

    Duane J
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-04-18 20:40
    Thanks all. I will have to try this after the meds wear off. Seeing double right now!!!
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-04-18 21:42
    Because of the 8x8 matrix structure, wouldn't there be an equipendency as far as being considered common cathode or common anode depending on if you were looking at it from a row (<- common cathode) or column (<- common anode) perspective?
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-04-18 22:27
    There's some discussion about these type of LEDs in this thread.
    This is the one I received. Thanks Duane.

    EDIT: Would any f these work? They came in the kit: 1
    1x Optocoupler 4N35
    2x Shift Register 74HC595N
    1x H-Bridge L293D
  • kwinnkwinn Posts: 8,697
    edited 2014-04-18 22:28
    Because of the 8x8 matrix structure, wouldn't there be an equipendency as far as being considered common cathode or common anode depending on if you were looking at it from a row (<- common cathode) or column (<- common anode) perspective?

    Jeez, had to google equipendency for this one. Good point though, particularly for an 8x8 array. Either one could be wired as common cathode or anode by treating rows as columns and columns as rows.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-19 09:40
    Because of the 8x8 matrix structure, wouldn't there be an equipendency as far as being considered common cathode or common anode depending on if you were looking at it from a row (<- common cathode) or column (<- common anode) perspective?

    Is it equipendency? Doesn't a common anode array needs a controller able to source 8 times the current it is required to sink? While a common cathode needs to sink a lot of current with a single pin.

    I know the MAX7219 can drive either type of array but I still have my doubts about using it with CA arrays (though it works).

    I know programming wise, I just need to swap the columns and the rows which is much the same as using a CC array rotated by 90 degrees.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-19 09:47
    NWCCTV wrote: »
    This is the one I received. Thanks Duane.

    EDIT: Would any f these work? They came in the kit: 1
    1x Optocoupler 4N35
    2x Shift Register 74HC595N
    1x H-Bridge L293D

    The two shift registers should be able to control the array.

    I don't know of any software to do this but shift registers are about the easiest IC there is to write a driver for.

    There are a lot of cheap MAX7219 chips on ebay. Don't pay more than $2 for a chip.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-04-19 10:25
    Duane Degn,

    "Doesn't a common anode array needs a controller able to source 8 times the current it is required to sink? While a common cathode needs to sink a lot of current with a single pin." - That all has to do with the driver. For the actual display you still have the same number of LED's on a common leg (Cathode or Anode) no matter how you slice it. That number will still require the same source (anode) or sink (cathode) current.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-19 10:50
    That all has to do with the driver. For the actual display you still have the same number of LED's on a common leg (Cathode or Anode) no matter how you slice it. That number will still require the same source (anode) or sink (cathode) current.

    It's the way a single pin my need to source or sink 8 times the current if the polarity of the display is switch that concerns me.

    As I said in the cheap array thread:
    Duane Degn wrote: »
    One thing that keeps nagging me about these boards is how the anodes and cathodes have been swapped from other array boards I've used. I'm not sure if the MAX7219 is designed to be used the way it is being used.

    I don't quite have the problem formulated in my head yet but I'm concerned about a possible asymmetry in the way the chip can handle sourcing and sinking current. With a common anode (which these arrays use) one pin on the MAX7219 will be sourcing 8 times the current it would normally have to source if using common cathode arrays. I should really dig through the datasheet and figure this out. I just thought I should warn the rest of you there may be a serious flaw in the design or these boards and these arrays may not be appropriate for use with the MAX7219.

    I did leave my populated board running several hours yesterday while scrolling text. I think I had the brightness set to its lowest setting though.

    I still don't have it straight in my head why I can use common anode displays with a MAX7219 chip.
  • xanaduxanadu Posts: 3,347
    edited 2014-04-19 18:37
    NWCCTV wrote: »
    Thanks all. I will have to try this after the meds wear off. Seeing double right now!!!

    Haha, are you sure it's not a 4x4 matrix?
  • kwinnkwinn Posts: 8,697
    edited 2014-04-19 21:55
    Duane Degn wrote: »
    Is it equipendency? Doesn't a common anode array needs a controller able to source 8 times the current it is required to sink? While a common cathode needs to sink a lot of current with a single pin.

    I know the MAX7219 can drive either type of array but I still have my doubts about using it with CA arrays (though it works).

    I know programming wise, I just need to swap the columns and the rows which is much the same as using a CC array rotated by 90 degrees.

    Duane, it's more to do with how the array is scanned than anything else. After all there are common connections to both anodes and cathodes in any array of leds. The common anode/cathode terminology is more of a holdover from 7 segment displays.

    If you scan by enabling each column in turn and lighting multiple leds in that column with the row drivers then the BL-M07C881 is common anode and the BL-M07D881 is common cathode.

    If you scan by enabling each row in turn and lighting multiple leds in that row with the column drivers then the BL-M07C881 is common cathode and the BL-M07D881 is common anode.

    The common connection driver will always need to be able to handle 8 times the current of the other (individual? non common?) connection.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-19 22:11
    kwinn wrote: »
    Duane, it's more to do with how the array is scanned than anything else. After all there are common connections to both anodes and cathodes in any array of leds. The common anode/cathode terminology is more of a holdover from 7 segment displays.

    If you scan by enabling each column in turn and lighting multiple leds in that column with the row drivers then the BL-M07C881 is common anode and the BL-M07D881 is common cathode.

    If you scan by enabling each row in turn and lighting multiple leds in that row with the column drivers then the BL-M07C881 is common cathode and the BL-M07D881 is common anode.

    The common connection driver will always need to be able to handle 8 times the current of the other (individual? non common?) connection.

    Thank you kwinn!

    You explained it just right to get it to click in my brain. Now that I understand this, I realize I had figured this out early on while playing with the LEDs but some how my brain let it slip.

    So even though the arrays I'm using are called common anode, I'm using them as common cathode since only one cathode at a time is being driven low and up to 8 anode are being powered.

    Again, thank you. This has been bugging me for a while. Now I know I'm not abusing the MAX7219 chips. They're being used as intended.

    Add one to the list of favors I owe you.
  • kwinnkwinn Posts: 8,697
    edited 2014-04-19 22:26
    No, it's the other way around. In a common anode display all the anodes are connected to the positive supply and some number of cathodes (of the leds you want lit) are connected (usually through some current limiting circuit) to the negative supply.
    Duane Degn wrote: »
    Thank you kwinn!

    You explained it just right to get it to click in my brain. Now that I understand this, I realize I had figured this out early on while playing with the LEDs but some how my brain let it slip.

    So even though the arrays I'm using are called common anode, I'm using them as common cathode since only one cathode at a time is being driven low and up to 8 anode are being powered.

    Again, thank you. This has been bugging me for a while. Now I know I'm not abusing the MAX7219 chips. They're being used as intended.

    Add one to the list of favors I owe you.
  • kwinnkwinn Posts: 8,697
    edited 2014-04-20 00:09
    BTW, "Add one to the list of favors I owe you." ? What favors do you owe me? Any help or suggestions I have posted comes with the same caveats Loopy Byteloose has in his signature. I'd add them to mine but stealing is something I try hard not to do.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-20 08:51
    kwinn wrote: »
    No, it's the other way around. In a common anode display all the anodes are connected to the positive supply and some number of cathodes (of the leds you want lit) are connected (usually through some current limiting circuit) to the negative supply.

    I'm not sure who isn't understanding whom, but I said the arrays are "called common anode" but I'm using them in common cathode mode. As you explained in post #16, these type of arrays can be used as either common cathode or common anode depending on how they are connected.

    Apparently MAX7219 chips don't require additional current limiting resistors. There's just one resistor used to set the overall current level and the chip takes care of the rest.

    Lately, I've been working on getting my monster 64 x 64 LED array up and running. Who would have thought 4,096 LEDs could put a strain on a power supply?
  • tomcrawfordtomcrawford Posts: 1,126
    edited 2014-04-20 08:53
    Just a note: common cathode common anode really has meaning when you have multicolor (say RGB) LEDs. Even if they aren't a matrix.
  • kwinnkwinn Posts: 8,697
    edited 2014-04-20 18:03
    Just a note: common cathode common anode really has meaning when you have multicolor (say RGB) LEDs. Even if they aren't a matrix.

    So very true.
Sign In or Register to comment.