7-segment LED driver (MAX7219) and alphanumeric digits

Discussion in 'The Projects Forum' started by LordPants, Sep 4, 2012.

  1. LordPants

    Thread Starter New Member

    Jul 19, 2012
    5
    0
    Hello, new user to the forum here!

    I've gleaned lots of fantastic information from this forum over the years, and never posted... but today I need some advice and I'm hoping someone can help me out.

    I am working on a project that requires 9 digits of 16-segment alphanumeric LED displays (sometimes called starburst displays). The project has to fit in a somewhat tight enclosure, so I'm trying my hardest to keep the component count down.

    I found the very excellent IC MAX7219 (datasheet), which is a 7-segment LED driver with constant current sinks and an 8-digit multiplexer. It's dead simple to use with an SPI interface, can run up to 64 individual LEDs, and can be daisy chained as much as you like. I have 4 of them running the other 7-segment displays in my project.

    The multiplexing works like this: the 7219 pulls the first digit pin low (DIG0), and then pulls the segments high that it wants to light up on that digit. Then it blanks everything, and pulls the next digit pin low, and pulls the segments high that it wants to light up on the second digit... and so on, at 250 Hz. There are 8 digit outputs (current sinks) and 8 segment outputs (current sources). Because it's a constant current driver, resistors are not needed for the segments.

    I am hoping that I can use the 7219 to drive my alphanumeric digits as well, if I just wire things up carefully and address pins appropriately in my software (which is running on Arduino, btw). I would like each digit to run HALF of a 16-segment display, so that a single 7219 can multiplex 4 alpha digits together. The problem I'm running into is separating the segment halves from each other, which needs to be done in hardware, not software.

    I am connecting two digit pins together to the common pin of the display, so the display has current sinked when either DIG0 or DIG1 go low. Then I'm connecting each of the segment pins to TWO of the display pins, so that the 8 segment pins can drive 16 display pins. My initial idea for separating the two was to add transistors to the display pins, which are switched on by the digit pins on the 7219.

    Here is a simplified diagram of my idea:
    Code ( (Unknown Language)):
    1.  
    2. +------------------------------+
    3. |           MAX7219            |
    4. +-+-----+-----------+----------+
    5.   |     |           |       ...
    6. DIG0  DIG1        SEG-A
    7.   |     |        /      \
    8.   +-----^-------NPN     |
    9.   |     +--------^-----NPN
    10.   \     /        |      |
    11.     AND          |      |
    12.      |           |      |
    13.   COMMON       SEG-A1  SEG-A2
    14.      |           |      |   ...
    15. +----+-----------+------+------+
    16. |  Alphanumeric LED Display    |
    17. +------------------------------+
    18.  
    Pins DIG0 and DIG1 are AND'd together and connected to the common pin of the display, and then the SEG pins are split so that each is connected (via transistor) to TWO pins on the display. With DIG0 active (sinking current), only the left half of each split would source current, and with DIG1 active, only the right half of each split would source current. In the full circuit: the 7219 has 8 DIG pins (DIG0 through DIG7) and 8 SEG pins (SEG-DP through SEG-G); the alpha display has 16 SEG pins (SEG-A1 through SEG-N), one COMMON pin, and one pin for the decimal point that I don't need.

    I have two questions about this scheme:
    1. Will the fact that the digit pins are trying to sink a constant current affect the operation of the transistors? (I'm not sure I wired those properly, anyway...)
    2. This requires a LOT of components... 16 transistors per display! In the interest of reducing component count, is there an easier or more clever way to do this?

    Thanks in advance for the advice.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    What are the transistors for? I've always hooked them up directly.
    You're still going to want resistors to limit current, and don't they have components for setting the maximum segment current and duty cycle modulation to boot?
     
  3. LordPants

    Thread Starter New Member

    Jul 19, 2012
    5
    0
    I can't send the SEG-A pin of the 7219 to two pins of the display without controlling which one is for which half of the display.

    So let's say I call the 8 outside segments the first half, (if lit up, it would be a zero), and the 8 inside segments the second half (if lit up, they would be an asterisk). The first half is associated with DIG0, and the second half is associated with DIG1. There's only one common pin on the display, and both DIG0 and DIG1 connect to it. With DIG0 active, the common pin is active, and the the SEG pins on the 7219 would light up segments in BOTH HALVES of the display. Then with DIG1 active, again, BOTH HALVES of the display would light up. I need a way to separate the halves. That's what the transistors are for.
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    Yes you can because the chip implements a scheme called "Charlieplexing" whereby the same signal line is both a segment driver and a digit driver.

    Sorry the Maxim website is "emerging tomorrow" whatever TF that means so I can't get to the datasheet to offer a better explanation.

    Found the datasheet. The MAX7219 is not the chip I was thinking of.
    I was thinking of the MAX6954. Sorry for the confusion.

    You can't do what you want with this part in that way. A 16 segment part needs stable segment lines as long as its single digit line is active. Your scheme works for the digit lines by anding them together, but you need a latch for the segment lines to hold them stable when you switch from digit 0 to digit 1. That is from "inner-half" to "outer half". The problem with an external latch is you lose your constant current source drivers.
     
    Last edited: Sep 4, 2012
  5. LordPants

    Thread Starter New Member

    Jul 19, 2012
    5
    0
    Yes, I know what Charlieplexing is.

    Maybe I wasn't clear above: the chip has 8 current sources and 8 current sinks. I need 16 current sinks and 4 current sources. The 7219 cannot do that on-board. I have to add extra logic outside the IC.
     
  6. LordPants

    Thread Starter New Member

    Jul 19, 2012
    5
    0
    Yeah, I looked at that chip. It would be perfect if I was using common cathode displays, but unfortunately my displays are common anode, and the starburst ones are somewhat difficult to find nowadays, especially in the colors I want. I got around that with the 7219 by wiring digits and segments "backwards" on the 7-segment displays (swapping current sources and current sinks) and doing some fancy bit matrix transposition in the code to send the right data. But I can't do that with the 6954 on a starburst display because it only has 8 current sinks.

    Thanks, though.
     
    Last edited: Sep 4, 2012
  7. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    Sorry for the multiple edits while I was trying to figure out what was going on. The forum is not quite equivalent to a real time chat.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    I see the problem you would have adapting these devices from 8 to 16 segments. It's pretty hard to keep them from interacting.

    Maxim does have a MAX6955 which should handle 8 Digits of 16-Segments all by itself. It's twice the price as the MAX7219but you do save all those transistors.
     
  9. LordPants

    Thread Starter New Member

    Jul 19, 2012
    5
    0
    Yeah, thanks for the suggestion. I looked at the MAX6955, actually, but it's common cathode. And since it only has 8 16-segment outputs, I can't do the same fancy matrix math I did with the 7219 in order to adapt it to my common-anode displays.

    At this point, I think it would be easier just to use 9 MAX6969 chips. Any solution trying to adapt three 7219 chips will require more components than that: either 16 transistors per display, or 2 quad-SPDT analog switch ICs (like the MAX394) per digit.
     
Loading...