Page 153 - ARM Based Microcontroller Projects Using MBED
P. 153
8.3 PROJECT 2—FOUR-DIGIT MULTIPLEXED 7-SEGMENT LED 139
variable CNT is set to 25 and both digits are disabled. The remainder of the program runs in
an endless loop established using a while statement. Inside this loop, the MSD and the LSD
values of the number to be displayed (i.e., CNT) are extracted and saved in variables
MSDValue and LSDValue, respectively. MSDValue is then sent to PORT C and
MSDEnable is set to logic 1 to enable the MSD digit. After 10ms delay, MSDEnable is dis-
abled, LSDValue is sent to PORT C, and LSDEnable is enabled. This digit is disabled after
10ms and the above process repeats forever until stopped by the user.
8.2.7 Modified Program
In the program in Fig. 8.5, a number less than 10 is displayed with a leading 0. For example,
number 5 is displayed as 05. We can disable the MSD digit if it is 0. This is shown in the pro-
gram in Fig. 8.6 (program: SevenSegMux3) where number 5 is displayed on the LED.
8.2.8 Suggestions for Additional Work
In Fig. 8.5, modify the digit enable time and see its effects on the display.
Modify the program given in Fig. 8.5 to display the letters HE and then LO continuously
with 1s delay between each display.
8.3 PROJECT 2—FOUR-DIGIT MULTIPLEXED 7-SEGMENT LED
8.3.1 Description
A two-digit 7-segment LED can only display numbers between 0 and 99. In applications
where it is required to display higher numbers, we can multiplex three or higher 7-segment
LEDs together. In this project, a 7-segment display is formed by multiplexing four LEDs so
that numbers 0–9999 can be displayed. In this project, the number 3579 is displayed as an
example.
8.3.2 Aim
The aim of this project is to show how four 7-segment LEDs can be multiplexed to display
numbers between 0 and 9999.
8.3.3 Block Diagram
The block diagram of the project is shown in Fig. 8.7. As with a two-digit display, the same
data are sent to all four display segments at the same time, but each digit is enabled for a short
time. The human eye sees that all the four digits are enabled at all times.
8.3.4 Circuit Diagram
Although there are four-digit 7-segment LED packages, in this project 2 DC56-11EWA-
type two-digit LEDs are used to form a four-digit LED as shown in the block diagram in