Shop OBEX P1 Docs P2 Docs Learn Events
Using 74HC595 to drive 8 X 8 LED Matrix — Parallax Forums

Using 74HC595 to drive 8 X 8 LED Matrix

beazleybubbeazleybub Posts: 102
edited 2010-05-19 17:02 in Propeller 1
Hi,

I'm learning about multiplexing and·DOT matrix displays and have purchased some 74HC595's.

Can I drive a small 8 X 8 DOT·matrix using the propeller and one·74HC595 similar to the schematic below without worry that I will draw too much current from the prop?

attachment.php?attachmentid=70464
Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
How can there be·nothing? Nothing is something!

Post Edited (beazleybub) : 5/19/2010 6:54:58 AM GMT
571 x 529 - 80K

Comments

  • LeonLeon Posts: 7,620
    edited 2010-05-17 02:08
    It depends on how much current you want to put through the LEDs. The Propeller outputs are pretty good in that respect.

    Where is the schematic?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • JonnyMacJonnyMac Posts: 9,102
    edited 2010-05-17 02:23
    What your schematic is missing is current limiters in the row drivers for the matrix.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-17 02:29
    In terms of current consumption, when you have no resistors it depends on the internal current limiting in the chip which you cannot control. Better to put in some resistors in the row drivers. Somewhere 100 ohm to 330 ohm depending on your led color, brightness etc.

    The other thing is that with an 8x8 display that is only 16 pins which only uses half the pins on a propeller, so no real need to use an HC595 (unless, of course, you are wanting to learn about those chips).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • DavidMDavidM Posts: 630
    edited 2010-05-17 02:41
    Hi, beaxleybub,

    You could try using a CHIP dedicated to the task such as..


    www.newark.com/austriamicrosystems/as1107pl/led-driver-ic/dp/59P3692

    They are half the price of the MAXIM equivalent ( MAX7219 ??)

    available in DIP & SMD

    All you need is one resistor to set the overall brightness/current, and only 3 lines from the prop chip

    I have a design using the AS1108 which is a 4 X 8 Matrix.


    regards

    Dave M
  • beazleybubbeazleybub Posts: 102
    edited 2010-05-17 02:52
    Dr_Acula,
    You're right, I am trying to learn about the 74HC595 chip
    I'm using a 24 pin bi-color 8 X 8 but for now I only plan on using 16 of them.

    DavidM,
    I·have samples coming from MAXIM and some from TI right now.

    Thanks everybody for the quick replies! It's great to know there is some helping hands here [noparse]:)[/noparse]


    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 5/18/2010 6:46:40 AM GMT
  • smbakersmbaker Posts: 164
    edited 2010-05-17 06:29
    Can you sink an entire column without exceeding the output limit on the 74HC595 ?

    I have a similar project here that I ended up throwing ULN2803 on after the shift register just to be safe. I think I was looking at sinking worst case 20ma per LED in my matrix = 160ma per column worst case.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-17 06:44
    "Can you sink an entire column without exceeding the output limit on the 74HC595 ?"

    Maybe you might get 2 or 3ma per led, and that could work for high brightness displays, although you then lose brightness with the multiplexing. A small signal transistor like a BC549 will give you up to 100mA and there are other transistors that can go to 800mA or more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • Michael O'BrienMichael O'Brien Posts: 55
    edited 2010-05-17 12:18
    Hi,
    ·· Just for reference, it is even possible to omit the current limiting resistors and any line drivers (and normal EE principles) and just drive the 8x8 LED directly from 2 (two) 74HC595 chips.
    ·· One acts as the column driver, the other as the row driver.· The propeller is isolated from any overcurrent.· The spin program consists of a· repeated 16 bit shift into both chips and requires 3 lines.
    ·· The brighntess of the LED's are normal and look the same as when 100 ohm resistors are used.· In my case the resistance of the breadboard and hookup wires provides enough current limiting.· This circuit has been running in various forms for months on different boards and has no problem even when the multiplexer is stopped and a single column gets the full duty cycle.· Here 4 rows of 8 are on to see contrast.
    ·· thank you
    ·· /michael
  • BTXBTX Posts: 674
    edited 2010-05-17 13:47
    Yeah !! Mchael & beazleybub.
    You can do it easily, and you can show video in 256 gray scale with that !!!, I did it in static scan, the task here is to do that in 1/8 scan. But I used two cogs for that task, anyway my ENC28J60 board can do that. (here's a picture)
    Also you could use a led driver chip, like the MBI5024/5026 or the TB62726 (I did not test that with the TLC5940).

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

    Alberto.
    320 x 240 - 38K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-17 14:23
    Re "In my case the resistance of the breadboard and hookup wires provides enough current limiting."

    That will be under 0.1 ohm I would hope. I suspect it is the internal resistance of the HC595 gates, which also what limits current for all sorts of cmos chips and why there are designs out there that don't need resistors.

    Re learning about the HC595 chip, is the next step to add more displays? If so, consider that if you drive all the row drivers at once, and scan through the colums, the brightness will decrease the more displays you add. With 100 columns, brightness is only 1%. Then you will definitely need driver transistors.

    But you can instead drive the rows one at a time, and turn all the columns all at once. Preload all the bits into the HC595, which a propeller can easily do fast enough (especially in pasm), then output them all at once (active low). Then the brightness never goes less than 1/8, or 12.5%.

    I finally grasped this concept after a very interesting discussion over in the Sandbox.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • beazleybubbeazleybub Posts: 102
    edited 2010-05-17 16:59
    I'm still learning so please understand that I might place myself in a position that would cause embarrassment. blush.gif
    I learn by example better than the traditional book teachings parallax provides. It's just easier for me that way.

    I found some example code for driving 74HC595 in the object exchange.
    The code was made to drive common cathode dot matrix but I am using common anode.

    Can this code be modified to drive my matrix and if so do·I need to add extra components?
    I might be wrong but can't the 74HC595 also sink the current?

    File attached.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-17 23:17
    Learning by doing is much more fun!

    The code should work fine. You can also cascade 595s - an unlimited number if you like. It just takes longer to clock out all the data.

    Re common cathode or anode, for anode, High = led on. For cathode, Low = led on.

    HC can source or sink current. Max rating is 25mA per pin.

    Are you building this on a breadboard?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • caskazcaskaz Posts: 957
    edited 2010-05-18 00:11
    Hi.
    I have made 8x8-Matrix.
    1024 x 768 - 161K
  • beazleybubbeazleybub Posts: 102
    edited 2010-05-18 07:09
    First of all I would like to thank everyone who has contributed to this post.

    Dr_Acula,

    Observing the spin code I posted earlier I noticed that there was no connection reference to the Rows.

    The matrix I currently have has rows that are common anode so I haven't tried to wire it up.
    I have another matrix coming from sparkfun that has common cathode rows and it should be here later this week.

    I assume that the common rows would be connected to pins on the propeller but I see no reference to them.
    Did the author of the Demo_Simple_74HC595.spin driver intend on me using two 74HC595's one for the columns and one for the rows?

    What am I missing here? Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!
  • smbakersmbaker Posts: 164
    edited 2010-05-18 07:39
    beazleybub said...
    I assume that the common rows would be connected to pins on the propeller but I see no reference to them.
    Did the author of the Demo_Simple_74HC595.spin driver intend on me using two 74HC595's one for the columns and one for the rows?

    From looking at the code, it looks like that demo only demonstrates how to set various bits in one of the 74HC595 shift registers. It looks like it's left to your interpretation to figure out how you'd want to configure the latches.

    Assuming you wanted one latch for rows and one latch for columns, I think (someone correct me if I'm wrong) that you could do the following:

    OBJ:
       shift_rows: "Simple_74HC595"
       shift_cols: "Simple_74HC595"
    
    PUB demo 
        shift_rows.init(ROW_CLOCK, ROW_LATCH, ROW_DATA)
        shift_cols.init(COLS_CLOCK, COLS_LATCH, COLS_DATA)
    
        ' assuming rows are anodes and columns are cathodes
    
        ' turn off all the cathodes by setting them to high 
        shift_cols.Out($FF)
    
        ' turn off all the anodes by setting them to low
        shift_rows.Out($00)
    
        ' light (row1, col1)
        ' set row 1 to high, set col 1 to low 
        shift_rows.SetBit(1,1)
        shift_cols.SetBit(1,0)
    
    



    I *think* the above may be what you're looking for. I have to confess that I've never instantiated the same object twice before in the same program, but I'm sure someone will correct me if I'm wrong.
    beazelybub said...
    The matrix I currently have has rows that are common anode so I haven't tried to wire it up.

    One other thing regarding maxtrix displays and anodes and cathodes .... If you wan't to make the rows cathodes instead of anodes (or vice-versa), can't you just rotate the display 90 degrees so that the rows are now columns and the columns are now rows?
  • beazleybubbeazleybub Posts: 102
    edited 2010-05-18 13:58
    smbaker said...
    One other thing regarding matrix displays and anodes and cathodes .... If you want to make the rows cathodes instead of anodes (or vice-versa), can't you just rotate the display 90 degrees so that the rows are now columns and the columns are now rows?
    You are right, But wouldn't everything then become backwards when it was displayed or scroll the wrong direction?
    I'm no electronics engineer but it's my guess I'd goof the reversal somehow.

    The whole purpose of this thread was for me to get some sort of idea on how dot matrix displays work and what the code consisted of.
    I now realize code would be chip specific and have similar but unique characteristics in order to get the dot matrix to function as intended.

    The best thing for me to do is figure out exactly what approach·I would like to use concerning interfacing the prop with a dot matrix and go from there.

    Everyone has been very kind and helpful.

    Thank you so much. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 5/20/2010 1:21:55 PM GMT
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-18 14:55
    Are you building one display or lots?

    I'm very interested in this as well. 8x8s are great but I'm not quite sure yet how to scale it up to more modules. So I went off on a tangent and looked at 14 segment displays. The driver is very similar - just use 14 row drivers instead of 8. I've got some 7x5 displays I'm tempted to try as well.

    See attached.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • beazleybubbeazleybub Posts: 102
    edited 2010-05-19 06:26
    Dr_Acula,
    Nice! Looks like you have vested much time in that board.

    I plan on just building one simple matrix test rig for now.
    I really want to concentrate on how matrix's work and learning to write my own driver program.

    In the future I hope to accomplish a 24x160 full color matrix with grayscale that would be used for a pinball machine.

    For now I will have to rely on·the forum and good old fashioned hard work.
    Eventually I'll make this happen with help form the community. I refuse to give up [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 5/19/2010 6:32:34 AM GMT
  • beazleybubbeazleybub Posts: 102
    edited 2010-05-19 17:02
    My Texas Instruments TLC5941PWP ( 16-CHANNEL LED DRIVER WITH DOT CORRECTION AND GRAYSCALE PWM CONTROL )
    came in the mail today! http://focus.ti.com/lit/ds/symlink/tlc5941.pdf

    Oh... My... God! These things are tiny!

    attachment.php?attachmentid=70476

    Found these on Ebay. Look for SMT to DIP adaptors, 0.025" 14-28 pin converter SMD #22
    ·attachment.php?attachmentid=70497

    Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How can there be·nothing? Nothing is something!

    Post Edited (beazleybub) : 5/20/2010 1:18:52 PM GMT
    268 x 262 - 46K
    500 x 216 - 21K
Sign In or Register to comment.