7-SEGMENT DIGIT CODES
Each segment of a 7-segment LED display has to be controlled by individual PICmicro MCU data lines. In principle, it does not matter in which order the data lines are connected to the display since the way that they are activated can be set from within the PICmicro MCU's controlling program.
For convenience in these tutorials, we use Port B lines RB0 to RB6 connected in their natural order to LED segments a to g. The decimal point of the display is connected to line RB7.
Illustrated above are the segments that display the numerals (digits) from 0 to 9. The segments required for each digit have their alphabetic codes quoted below the digit (the decimal point is not shown).
Two lines of binary codes show the bits that need to be set or cleared accordingly. The upper code is for common cathode displays, the lower code is for common anode displays.