Microcontrollers

The 7-segment common-cathode LED display

The 7-segment common-cathode digit consists of eight LEDs arranged as shown. By selectively applying a high logic to current-limiting resistors connected to the LED anodes and grounding the common cathode, user defined bit patterns can be displayed. With a high logic applied to the cathode, all the segment LEDs will be off. There are also displays with a common anode that operate in a complementary fashion.

Display multiplexing

The dual 7-segment display shown consists of two 7-segment digits in one package. Other formats include groups of four, eight or more 7-segment digits enclosed in the same package, each digit having it's own common cathode. Some multiple displays also have the a-g,dp segments internally connected.

The dual display digits shown could be independently controlled by connecting every a-g,dp segment to one of sixteen PIC pins, eight for each digit, and grounding the two common cathodes.

A better approach, called multiplexing, is to connect together the corresponding a-g,dp pins of all the digits and use the common cathodes to sequentially activate each digit to display the pattern currently presented to the a-g,dp pins. At a scanning rate faster than the eye can percieve, all the digits will appear to be on at the same time.

Since only an extra cathode control pin is needed for each digit, this results in significant savings of PIC resources, especially for larger displays of N diigits, with the required output pins being 8+N rather than 8*N.

As always, there are practical considerations to take into account. Since a digit cathode sinks to GND the current of all eight LED segments, when all the segments are lit the cathode current could be up to eight times the LED segment current. If this current exceeds the current limit of a PIC pin intended to control the cathode, then a transistor must be used to switch the cathode current. The PIC pin, now connected to the base of the transistor, will require a minimal current to control the digit.