Connect with us

µC LED Driver 7 Segment

Discussion in 'Electronic Design' started by Rieker Flaik, Apr 8, 2004.

Scroll to continue with content
  1. Rieker Flaik

    Rieker Flaik Guest


    I'm trying to build some funny addons for the best Computergame namend
    Descent 2.

    You can find it under open Sourcecode namend d2x here:

    So it would be great to have some nice looking 7 Segment Displays for some
    stats. Mounted on a nice plate, it would give a good look and would be the
    first step into a Simulator ... *dream on* ;-)

    I learned some basics from here:
    and here:

    in programming ATmega16-µController.

    The main Problem for my Game-addon-Project is that I do not know howto
    connect a minimum of 20 7 Segment Displays to this Controller.
    I need a good, a very good driver. It would be great to have on controlled
    by I2C or SPI.

    I googled and found a MAXIM MAX6956 here:

    they sax it's a 28-Port LED Display Driver and I/O Expander,
    does that mean 28 7 Segment Displays, or what?!?

    It would be great if someone would know a example-Project that would fit
    into my needs. May be a bit different, but useable.

    Thx for your answers, regards

    Rieker Flaik
  2. The maxim MAX6956 driver can be used to drive 4 7seg displays.
    There are others like the MAX7221 8 digit driver. You can address them on the SPI buss with the Uc port pins. Its not hard to do.

  3. The answer you are searching for is 'multiplexing'! That is, wire up the
    segments from each of your 20 displays in parallel, then drive each common
    seperately from an i/o pin (via a transistor) on your micro. If you dont
    have 20 spare i/o's for the commons, you could use a shift register or a
    binary decoder, such as a 74hc138 or (from memory) the bigger 74hc154.
  4. To expand on this a little:

    You do not need special driver chips for this, which might be hard to
    get and fairly expensive. Since you've got a microcontroller, you can
    use it to do the multiplexing of the display in software. The additional
    hardware you need around the miorocontroller consists of standard parts
    that are readily available.

    Multiplexing means that you drive only part of the display at a time.
    Rapid cycling through the separate parts creates the impression that all
    parts light up simultaneously. This approach saves some expense in
    driving electronics. The alternative would be static drive, which
    provides a separate driver for each LED, but is simpler to deal with
    because no rapid cycling is needed.

    I understand that you need to drive 20 7-segment digits, so that amounts
    to 140 LEDs (or 160 LEDs, if you add the decimal points). A convenient
    multiplexing matrix would arrange those in a 10x16 matrix, where one row
    of 16 LEDs is active at a time (a 10:1 multiplex). Lets suppose you have
    common anode 7-segment displays. You would then have 10 groups of 2
    digits each with the anodes of each group being connected to a row line
    and the cathodes connected to their separate column lines. To activate a
    row, you need to pull it up to the positive supply voltage. In this row,
    individual LEDs are then switched on by pulling their corresponding
    cathode line low.

    Since a row is only activated one tenth of the time, you will need to
    increase the current through the LED above the normal rating in order to
    maintain brightness. If a LED in a 7-segment display would normally be
    driven with 5mA, it would need 50mA pulses in your multiplexed array. So
    the cathode drivers need to be able to sink 50mA. As there can be up to
    16 LEDs in a row, which can be active at the same time, your row driver
    must be able to source pulse currents of up to 800mA. The pins in a
    microcontroller such as the ATmega16 are not able to handle such
    currents, so you will need driver transistors. These are standard stuff
    that can be bought everywhere.

    For the row drivers, you need 10 PNP transistors of suitable current
    capability and high current amplification. For the 16 column drivers you
    can use just about any cheap NPN small signal transistor. There are many
    types available and for actual part recommendations I'd need to know
    what packages (manufacturing technique) you prefer.

    The base of each transistor will be driven by a pin on the ATmega16
    through a current limiting resistor. So this will consume 26 pins of the
    ATmega16, leaving you with a few remaining pins for connecting to your
    game computer.

    The current through the LEDs will need to be limited using a resistor,
    too. Each column line will need one that limits the current to 50mA.

    So your bill of materials will include the ATmega16, 16 NPNs, 10 PNPs,
    20 common anode 7-segment displays and a fistful of resistors. Add a
    couple of decoupling caps. No fancy exotic parts needed.
  5. On Fri, 09 Apr 2004 10:39:49 +0200, the renowned Stefan Heinzmann

    You can also go with a couple of ULN2803s and a couple of source
    drivers, plus 16 resistors (could be 2 or 4 networks). 6-8 parts
    total, plus the displays.

    Best regards,
    Spehro Pefhany
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day