Shop OBEX P1 Docs P2 Docs Learn Events
Need help using 6 daisychained 74hc595's to drive a 40x8 dot-matrix screen — Parallax Forums

Need help using 6 daisychained 74hc595's to drive a 40x8 dot-matrix screen

I'm making a clock and part of it is a big Smile screen of 8x40 leds. But I'm having trouble driving it. You need a loooot of output pins to drive that kind of screen.

I assembled a driver for the screen myself. I daisychained six 74hc595 chips to drive the 40 columns and to sink the current of the 8 rows (through transistors). You can see the schematic here.

Here is the datesheet of 74hc595

But writing the code, I got in a bit of a pickle. I can't seem to get a non-flickering image. And even worse, if I use a lot of 'heavy' characters that light a lot of leds, the image gets worse and more flickery. Here's the code I'm using.

Any ideas? 'cause this is kind of exceeding my capacities.

Comments

  • Welcome to the forums!

    You did not mention the controller that you are using. Basic Stamp? Propeller?

    Also no code was included with your post.

    More information is needed to get a proper answer.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2017-07-04 16:15
    Instead of daisy chaining them, consider paralleling all of the SRCLK's and SER's and loading them that way, making use of the RCLK to update or latch only the "banks" that change. The throughput will be faster that way and help minimize any flickering.
  • tonyp12tonyp12 Posts: 1,951
    edited 2017-07-04 17:28
    How many MCU pins do you want to dedicate to this?
    1pin: can be done: The sink-mosfet gets its signal from the 595.



    4pins makes it easier, inserting dead-time between sink-mosfet will help with capacitance on the lines that could light up wrong LEDs for 1/100sec
    10pins and you can parallel them instead.


  • jmgjmg Posts: 15,173
    ..... I can't seem to get a non-flickering image. And even worse, if I use a lot of 'heavy' characters that light a lot of leds, the image gets worse and more flickery. Here's the code I'm using.

    Any ideas? 'cause this is kind of exceeding my capacities.
    If things get worse with more LEDs, that's usually a sign of bounce effects, aka too many spikes from the high current edges.
    Can you drop the LED current right down, and just light one led, and move that across the display ?
    That reduces bounce and lets you confirm you can drive ok.
    From there, increase the LED current, and number of driven LEDs and see what breaks.
    Bad cases of bounce may need local isolation and multiple ground wires - the effects can be at Host-> first C595, and then C595->C595
    Some mitigation could be possible with a blank-shift, where you disable LED drive, clock the registers, and then enable.
    If the x8 drivers are under your full control, that can be a good place to blank, as they can have slower Tr,Tf


    There are higher-current C595's - drop 6C595 into Digikey's search, to find a few.
    These are sinking parts, so would require you flip the LED Drive, which it may be too late to do.

  • MIchael_MichalskiMIchael_Michalski Posts: 138
    edited 2017-12-05 03:44
    What about using the video generator to output the data? You shift the data into the shift registers as fast as it will take them. You can shift 32bits at a time out at 125mhz.

    Actually, if you think about it the logical and physical matricies don't have to be the same. You have 320 LEDs. If i we're to do it with shift registers, I would use 12 output lines from the propeller. One would be a serial output from the video generator. One would be the video generator clock. This would drive a 32 bit shift register. I would scan it a row of 32 LEDs at a time. The other 10 propeller output lines would select individual rows. It could be implemented with two 16 bit shift register ICs.

  • What about arranging them into a 18x18 matrix. Drive them from a 18 bit shift register. Use the video generator to output the data. You can do it in a single instruction.


  • But writing the code, I got in a bit of a pickle. I can't seem to get a non-flickering image. And even worse, if I use a lot of 'heavy' characters that light a lot of leds, the image gets worse and more flickery. Here's the code I'm using.

    Any ideas? 'cause this is kind of exceeding my capacities.

    I do not see the code listed. Did you attach it or put in the post? If not, could you provide the code you are using? Also, could you provide a video of the display flickering as you mention?
    It may just be a timing issue you are running into.
  • kwinnkwinn Posts: 8,697
    The flickering could be because the data is not being refreshed fast enough or the timing of the serial clock and register clock is not correct.

    If you are using 6 '595 chips and shifting out 48 bits (40 for video, 8 for row select) spin may be a bit too slow even if you use a dedicated cog for that. C would probably be fast enough, and PASM most certainly is. Post the code you are using.
  • kwinn wrote: »
    The flickering could be because the data is not being refreshed fast enough or the timing of the serial clock and register clock is not correct.

    If you are using 6 '595 chips and shifting out 48 bits (40 for video, 8 for row select) spin may be a bit too slow even if you use a dedicated cog for that. C would probably be fast enough, and PASM most certainly is. Post the code you are using.

    Id use the video generator. It can put out data upto 125mhz.

  • Heres a document from ST that should be useful.

    http://www.st.com/content/ccc/resource/technical/document/application_note/be/93/fe/64/3e/08/46/52/DM00038253.pdf/files/DM00038253.pdf/jcr:content/translations/en.DM00038253.pdf

    page 49 is especially interesting. It shows how to use the current sink output lines to be current source lines in a matrix by using driver transistors.


    heres the link to TIs led signage driver page
    http://www.ti.com/power-management/led-driver/signage-large-display/overview.html

    heres a article on how to design led signs and displays. Its geared toward something a quite a bit more involved than your project but the basic principles are the same.

    https://www.edn.com/design/led/4432914/How-to-design-LED-signage-and-LED-matrix-displays--Part-1


    TI makes some great options

    http://www.ti.com/lit/ds/symlink/tlc5955.pdf
    It has 48 lines. Use the first fourty for the columns. Use a transitor array with 8 transistors with the last 8 outputs (so they can be current sources instead of sinks) and thats pretty much the whole thing. Its a bit involved to program though. Using the video generator at 25mhz will make it easy to output the 768 bit command stream in a reasonable time. ( presumably most of it wont change) The advantage here is you only need the one 56 pin tsop chip plus a resistor pack and a transistor array (plus misc filter caps and the odd resistor as needed). If you dont want to deal with the tsop,you can readily get a breakout board off amazon or ebay that makes it into a 56 pin DIP)

    http://www.ti.com/lit/ds/symlink/tlc5920.pdf
    It has 16 lines that are current sinks to control the rows PLUS 8 current source lines to control the columns. You could use 3 of them together. That gives you 48 channels. The extra 8 lines could be ignored or possibly could be connected through pull up resistors to control the column lines. Then you just output to port a to latch the data and unblank the display. You could also arrange your matrix electrically as 10x32 (it can physically be any way you want) and translate in software to the real display. After all,with 8x40, its not going to be completely clean anyway. You can store 8x32 as 8 32bit words, but then the remaining 8x8 block is going to have to be kinda tacked on. Might as well store them as two additional 32 bit words. (I guess you COULD store the whole thing as 40 8 bit words and access them byte wise from main memory,but that seems almost as clunky. I bet the time it takes to access them is going to be far more than the time it would take to translate those two extra rows into a block of 8x8=64 leds) If you arrange them as 10x32 then you can get away with just two of the chips,just like above, but then you have to have 10 driver transistors. You could get clever and make it so each line turns on one and turns off one,then you only need 5 lines. You could also use 4 bit decoder.

    There are tons of variations.


Sign In or Register to comment.