►Seven-Segment Display Example

The segments in a 7-segment display are arranged to form a single digit from 0 to F. We can display a multi-digit number by connecting additional displays. Even though LCD displays are more comfortable to work with, 7-segment displays are still standard in the industry. This is due to their temperature robustness, visibility and wide viewing angle. Segments are marked with non-capital letters: a, b, c, d, e, f, g and dp, where dp is the decimal point. The 8 LEDs inside each display can be arranged with a common cathode or common anode. With a common cathode display, the common cathode must be connected to the 0V rail and the LEDs are turned on with a logic one. Common anode displays must have the common anode connected to the +5V rail. The segments are turned on with a logic zero. The size of a display is measured in millimeters, the height of the digit itself (not the housing, but the digit!). Displays are available with a digit height of 7,10, 13.5, 20, or 25 millimeters. They come in different colors, including: red, orange, and green.


The simplest way to drive a display is via a display driver. These are available for up to 4 displays. Alternatively displays can be driven by a microcontroller and if more than one display is required, the method of driving them is called "multiplexing."


The main difference between the two methods is the number of "drive lines." A special driver may need only a single "clock" line and the driver chip will access all the segments and increment the display. If a single display is to be driven from a microcontroller, 7 lines will be needed plus one for the decimal point. For each additional display, only one extra line is needed. To produce a 4, 5 or 6 digit display, all the 7-segment displays are connected in parallel. The common line (the common-cathode line) is taken out separately and this line is taken low for a short period of time to turn on the display. Each display is turned on at a rate above 100 times per second, and it will appear that all the displays are turned on at the same time. As each display is turned on, the appropriate information must be delivered to it so that it will give the correct reading. Up to 6 displays can be accessed like this without the brightness of each display being affected. Each display is turned on very hard for one-sixth the time and the POV (persistence of vision) of our eye thinks the display is turned on the whole time. Therefore, the program has to ensure the proper timing, else the unpleasant blinking of display will occur.



Connecting a microcontroller to 7- segment displays in multiplex mode


Program "7seg.asm" displays decimal value of a number stored in variable D.
Example:
movlw .21 	 
movlw D 	; number 21 will be printed on 7seg display


Displaying digits is carried out in multiplex mode which means that the microcontroller alternately prints ones digit and tens digit. TMR0 interrupt serves for generating a time period, so that the program enters the interrupt routine every 5ms and performs multiplexing. In the interrupt routine, first step is deciding which segment should be turned on. In case that the tens digit was previously on, it should be turned off, set the mask for printing the ones digit on 7seg display which lasts 5ms, i.e. until the next interrupt.


For extracting the ones digit and the tens digit, macro digbyte is used. It stores the hundreds digit, the tens digit, and the ones digit into variables Dig1, Dig2, and Dig3. In our case, upon macro execution, Dig1 will equal 0, Dig2 will equal 2, and Dig3 will equal 1.


The following example shows the use of the macro in a program. Program prints a specified 2-digit number on a 7seg display in multiplex mode.




◄ Previous Page  |  Next Page ►

Back To Index

Conversation

ElectronicManiac
Tue Mar 31 2015, 03:33 PM
anyone?
ElectronicManiac
Tue Mar 31 2015, 03:33 PM
Please Reply me on Scrolling Dot Matrix LED Display using 8051
Tue Mar 31 2015, 10:32 AM
Akshayy
Can you please provide the proteus file
ajay_bhargav
Tue Mar 31 2015, 04:14 AM
@Peter james, we have many projects related to this, Please refer download section and tutorials or post in forum for specific questions.
Mon Mar 30 2015, 04:51 PM
Peter james
can any one provide me an assembly language program to interface with 16x2 LCD, 4X4 Keypad and a GSM Module to recieve message and display it.
ajay_bhargav
Mon Mar 23 2015, 04:22 AM
You can only simulate simple 8051. RD2 support is not there in proteus. However there are similar atmel varient which can be used instead.
Sun Mar 22 2015, 07:24 PM
Aryan Nath
How can i Simulate microcontroller project in Proteus that uses P89V51RD2
Thu Mar 19 2015, 02:45 PM
Peter Mann
I have tried to register on the site, but it keeps saying I've entered two different email adresses - but I haven't!
ajay_bhargav
Sun Mar 15 2015, 08:25 PM
I did not get new message indication.. strange..
ExperimenterUK
Sun Mar 15 2015, 08:18 PM
slight delay, my connection failed

Downloads

Comments

sund1212
Tue Mar 31 2015, 04:47 PM
ElectronicManiac
Tue Mar 31 2015, 03:21 PM
harix
Sun Mar 29 2015, 07:11 PM
marti
Fri Mar 27 2015, 03:07 PM
iamalien
Thu Mar 26 2015, 07:27 AM
Ankit30
Wed Mar 25 2015, 02:35 PM
wai1023
Wed Mar 25 2015, 06:27 AM
StrangerDanger
Tue Mar 24 2015, 12:40 PM

Online

Guests: 41, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37613
Newest member: sund1212
Forum Activity
diana1234 Avatar
Posted By diana1234
Tue Mar 31 2015, 11:17 AM
Thank you sir for the reply,As you give the LED ex...
mayank058 Avatar
Posted By mayank058
Tue Mar 31 2015, 06:44 AM
Dear Iamalien, Thank you ...
mayank058 Avatar
Posted By mayank058
Tue Mar 31 2015, 06:33 AM
Thanks to all of u for showing your interest in my...
iamalien Avatar
Posted By iamalien
Tue Mar 31 2015, 04:43 AM
here you go a 227 variable array in the ram and st...
ajay_bhargav Avatar
Posted By ajay_bhargav
Tue Mar 31 2015, 04:33 AM
Can you post Keil compiler output?
iamalien Avatar
Posted By iamalien
Tue Mar 31 2015, 04:31 AM
i have already compiled the program in keil thats ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Tue Mar 31 2015, 04:29 AM
Its in nature of resistor to reduce the current wh...
ajay_bhargav Avatar
Posted By ajay_bhargav
Tue Mar 31 2015, 04:10 AM
256 bytes ram for 200 char display... I think you ...
diana1234 Avatar
Posted By diana1234
Mon Mar 30 2015, 08:12 AM
Dear sir,How a resistor can be used as a current l...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Mar 30 2015, 05:13 AM
The processor on the MCB2300 has a built in DAC.Cr...