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.
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.