Shop OBEX P1 Docs P2 Docs Learn Events
running 64 leds with max 7219 — Parallax Forums

running 64 leds with max 7219

youngbillyoungbill Posts: 54
edited 2010-11-15 12:13 in BASIC Stamp
Has anyone used a maxim 7219 to run 64 LEDS. Some of my questions are,do i run the leds off the segment pins? And if so..that only allows 7 leds?
Any Help or Code hints , thanks for any replys

Comments

  • hover1hover1 Posts: 1,929
    edited 2010-11-11 12:37
    I have run 192 LEDs off of 3 Max7219 in series, using each segment to an LED. Gonna take an hour or so to find the code, (not near that computer).

    Jim
    youngbill wrote: »
    Has anyone used a maxim 7219 to run 64 LEDS. Some of my questions are,do i run the leds off the segment pins? And if so..that only allows 7 leds?
    Any Help or Code hints , thanks for any replys
  • youngbillyoungbill Posts: 54
    edited 2010-11-11 16:14
    Yea any help is much appreciated.Not much info "out there" on this circuit.
    Thanks again...

    But with only 7 segments,,ahh multiplexed leds,,,so I guess i need to decide on the pattern of lights I want...I was thinking ,,,just a chase of 64 leds,,,that end up ALL ON.
  • hover1hover1 Posts: 1,929
    edited 2010-11-11 18:30
    Just remembered, that project was a Propeller project. Will try to find some BS2 stuff I might have saved tomorrow.

    Have you done a search on MAX 7219 (or MAX7219) in the new forum? It brings up quite a bite of hits.

    Jim
  • youngbillyoungbill Posts: 54
    edited 2010-11-11 20:47
    I thought of shift>> or shift<<....but this allways brings a zero in,,,and as such ,the display will have only one led on at a time..( Knight rider look)..
    Is there a shift>> that can shift a one in?

    Also the max 7219 will not handle the current of 64 leds, should I use a transistor( I am planing to ),,,or use the app note 1196 driving higher currents?
  • MoskogMoskog Posts: 554
    edited 2010-11-11 22:58
    youngbill wrote: »
    Also the max 7219 will not handle the current of 64 leds, should I use a transistor( I am planing to ),,,or use the app note 1196 driving higher currents?

    Max can handle 64 individual LEDs, Remember the word Multiplexing.
    It is made to run an 8-digit seven-segments LED-display. Thats 64 individual LEDs, the dots included. Needs only one current-limiting resistor because only one segment (or LED) is lit at a time.
  • electrosyselectrosys Posts: 212
    edited 2010-11-12 00:10
    Gadget Gangster has a project/kit with the Max7219 and 8X8 LED module/s there is datasheet with schematic for assembly instructions of Max7219, LED module and some code examples (the code examples are not for BS2, but for PicBasic and Arduino) The Blue LED Matrix: http://gadgetgangster.com/find-a-project/56.html?projectnum=282
  • Coder96Coder96 Posts: 42
    edited 2010-11-12 08:56
    There is a blog post for using blue matrix with the prop.
  • ZootZoot Posts: 2,227
    edited 2010-11-12 12:45
    The 7219 and 7221 are designed to run 8 banks of LEDs -- each bank has 8 leds, all with their CATHODES tied together. So, essentially, each set of 8 leds has 9 "pins" -- 1 for all the cathodes, and 1 for each anode. Secondly, every bank has it's corresponding anodes tied together. I.E., every LED1 in each bank is connected by anode.

    The MAX works by rapidly enabling the common cathode line for each set of 8 leds, then lighting the individual anodes required for the chosen LEDs to light. Then it turns off that particular set (by turning off the common cathode line), and moves on to the next set of 8. This allows for driving 64 leds with 16 pins. It all happens so fast, you can't see it.

    Current limiting is actually done through true current limiting internal to the chip (it's not because "only one segment (or LED) is lit at a time" -- in a sense, the chip has configurable "resistors" on every led anode line -- the value of that current limiting is set by the iSense resistor. A formula for determining that value is given in the chip datasheet. Technically, all 8 leds in a given common cathode bank might be lit at any one time (this is useful for determining total current draw of the project). For example, if you have each LED set to draw 20ma, and all 8 of a given bank are lit, then total max current draw for the LED display would be 160ma plus the chip's own overhead.
  • MoskogMoskog Posts: 554
    edited 2010-11-12 13:42
    Zoot, thanks for clearing up this in detail, what I said was just the light-version, more to explain that in a normal situation you don't really need to use any external transistors to run all those segments, or LED's.
  • youngbillyoungbill Posts: 54
    edited 2010-11-13 13:50
    Ahh,I will have to read this very carefully,I have a board made with 8 leds..per board ONLY thing is I do have a 220 ohm resistor in series with each led. ( Explains why they were dull,,,I say WERE , Dull because the two 8 led boards I had pre made are not even working now,, It stopped when I changed the code).

    Attached is my code,,I want a 64 led chaser,,, ending with ALL the leds on.

    I would attach a schematic,,,can anyone suggest how to draw the wiring out so I can post it also ( I have circuit maker,but I doubt many people would be able to view that)
    So I should be able to chase 64 leds Correct?...and I should just run the leds direct ( ie no resistor ?) Many thanks for all the help on this great board.
    Pls Comment on my code also.
    One other thing,,,Decimal point pin 22 will this be used as is,,,ie will that pin run a leg of leds also..so do I need to activate DP...by adding 128?
  • ZootZoot Posts: 2,227
    edited 2010-11-13 16:24
    On each board, if you have 8 leds, connect all the cathodes together and run one wire out for that "bank's" cathodes.

    Then remove the individual segment resistors for each LED and run 8 wires out for the "bank's" anodes.

    When you have all 8 boards ready like that, connect EACH BOARD's "led number 1" wires together, and run one wire from that connection of 8. That is your wire for all "number 1 led anodes". Do the same for number "2" on each board, up through number 8.

    At that point you should have:
    8 cathode wires -- one to each board, where every LED cathode on the board is connected to each other and that cathode wire.

    8 anode wires -- each goes to ONE led on EACH board, the same LED position on each board.

    Now hook up those 16 wires to the MAX display. The 8 anodes are the SEGMENT lines and the 8 cathodes are the DIGIT lines.

    When the MAX is fired up properly using SHIFTOUT with the correct commands, it "strobes" the cathodes very rapidly and takes care of everything, making all LEDs appear to be lit at once, or any given LED, etc. Additionally, there are commands for the MAX that let you dim the entire display (in 16 steps of brightness), as well as set blanking and such. The only two commands that are really critical for your purposes is to make sure HEX DECODE is OFF (otherwise it will interpret LED data bytes sent as "hex characters" for display on a seven-segment LED) and that you have the display size set to EIGHT DIGITS (8 "banks" of 8 LEDs).

    To light all LEDs you would just shift out %11111111 to each "digit". Basically you can always send 8 bytes (one bit for each LED) to the MAX to tell it if any given LED is on or off. It takes care of making all the LED's "appear" to be lit at once.
  • youngbillyoungbill Posts: 54
    edited 2010-11-13 16:39
    Ahh,I have it miss wired,,,I tied all anodes together,on the one board,,I will try this repair ...Thanks
  • tdg8934tdg8934 Posts: 126
    edited 2010-11-14 04:18
  • youngbillyoungbill Posts: 54
    edited 2010-11-15 12:13
    Thanks TGD...I have a better wiring connection now,,,I see the max needs common anode column...would it not work also with common cathode column,,,just switch digit drive to the columns?
    Any way
    I want the leds to chase on, in a long row,,,and stay on as the chase goes along,,,,Its starting to work,,,but now its a code thing,,,Can any one give any help to my code.
Sign In or Register to comment.