10.2 PROJECT 10.2 – Display a Number on 2-Digit 7-Segment LED Display

10.2.1 Project Description

This project shows how more than one 7-segment display can be multiplexed. In this project, we will display number 45 on a 2-digit display as an example.

10.2.2 Block Diagram

The block diagram of the project is shown in Figure 10.7.

Figure 10.7 Block diagram of the project

img

10.2.3 Circuit Diagram

The circuit diagram of the project is shown in Figure 10.8. The displays are connected in parallel to PORT D of the microcontroller. Each digit is enabled separately by connecting a transistor as a switch to its common cathode pin. Setting the base of the transistor to logic HIGH turns the transistor ON and enables the corresponding display digit. PORT A pins RA0 and RA1 are used to control the display enable lines. With multiplexed displays, each display is enabled for several milliseconds and the human eye thinks that all the LEDs are ON at all times. As an example, a two digit 7-segment display is operated as follows:

  • send digit 1 number to PORT D;
  • enable digit 1;
  • wait for a few milliseconds;
  • disable digit 1;
  • send digit 2 number to PORT D;
  • enable digit 2;
  • wait for a few milliseconds;
  • disable digit 2;
  • repeat above steps forever.

If you are using the EasyPIC 7 development board, then make sure you set to ON position switches SW4.1 (i.e. DIS0) and SW4.2 (i.e. DIS1), to enable the rightmost ...

Get Using LEDs, LCDs and GLCDs in Microcontroller Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.