Electronic – Multiplexing 2 digit 7Segment with one Bit

7segmentdisplaydigital-logicmsp430multiplexer

I want to control a 2 digit 7-segment LED with a MSP430 micro controller. The display has 8 input pins per digit (8th pin is the dot, which I do not need) and two ground pins (common cathode). The idea is to connect the first 7 pins from the µc to the 7 segments of both digits and then use another pin (the control pin) for selecting which digit to display. By switching fast between the two digits I would like to display a two digit number using 8 pins of the µc only.

What I need is the following. We can abstract such that there are only two LEDs.
If the control pin is LOW than LED1 is on and LED2 is off. If the control pin is HIGH then LED2 is on and LED1 is off. I know how to build this with a single PNP transistor (see picture below). However, this is not useful in the common cathode setting, since I want the switching gate "behind" the LEDs.

What I don't want to have

My question is, how to build such a circuit with one single transistor (and resistors of course). I think it has to be a NPN transistor.

This is my first EE question and I have little experience, so I hope I was able to make my question clear.

Best Answer

You are right about the NPN transistor, that is what you need in order to achieve that behaviour, however, since the µC would have to control the cathode of one of the displays, that would be a problem since most µC can only source / sink a few mA. Assuming each segment needs 10mA that would require the pin to sink 70 mA.

The most simple solution is to have two NPN transistors capable of sinking at least 100 mA (such as the common BC547).

Diagram bellow:

Diagram

Being D1 and D2 the 7 segment displays (please ignore the reference). The anodes on the LEDs will connect to the µC pins.

In this configuration only Q1 conducts when the µC outputs 1 and when it outputs 0 only the Q2 conducts.

Note
It might be necessary to add a high value pull-up resistor (for example 100 kΩ) to the base Q2.