as 1972 for track signaling applications in model railroading. Traditional multiplexing Display multiplexing is very different from multiplexing used in data transmission, although it has the same basic principles. In display multiplexing, the data lines of the displays* are connected in parallel to a common databus on the microcontroller. Then, the displays are turned on and addressed individually. This allows use of fewer I/O pins than it would normally take to drive the same number of displays directly. Here, each "display" could, for instance, be one calculator digit, not the complete array of digits. When using Charlieplexing, n drive pins can drive n digits with n − 1 segments. When simplified, it equates to n pins being able to drive n2 − n segments or LEDs. Traditional multiplexing takes many more pins to drive the same number of LEDs; 2n pins must be used to drive n2 LEDs (though a 1-of-n decoder chip can be used to reduce the number of microcontroller I/O pins to ). If the number of LEDs is known, then the previous equation can be worked backwards to determine the number of pins required. That is, L LEDs can be driven by pins. Complementary drive Charlieplexing in its simplest form works by using a diode matrix of complementary pairs of LEDs. The simplest possible Charlieplexed matrix would look like this: By applying a positive voltage to pin X1 and grounding pin X2, LED1 will light. Since current cannot flow through LEDs in reverse direction at this low voltage, LED2 will remain unlit. If the voltages on pin X1 and pin X2 are reversed, LED2 will light and LED1 will be unlit. The Charlieplexing technique does not actually make a larger matrix possible when only using two pins, because two LEDs can be driven by two pins without any matrix connections, and without even using tri-state mode. In this two-LED example, Charlieplexing would save one ground wire, which would be needed in a common 2-pin driver situation. However, the 2-pin circuit serves as a simple example to show the basic concepts before moving on to larger circuits where Charlieplexing actually shows an advantage. Expanding: tri-state logic If the circuit above were to be expanded to accommodate 3 pins and 6 LEDs, it would look like this: This presents a problem, however. In order for this circuit to act like the previous one, one of the pins must