►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

Sarvn
Sat Jul 22 2017, 11:42 AM
I wnt to learn embedded could anyone help me
Sarvn
Sat Jul 22 2017, 11:41 AM
Hi
Wed Jul 12 2017, 09:04 AM
Ushiwaka
Any good guides on how to interface an 8255 w/ an 8051?
Tue Jul 11 2017, 12:52 PM
Chiko
i need seconds added to this circuit, can you help me modify it and add codes too
ExperimenterUK
Wed Jul 05 2017, 07:55 PM
@martinsnc115877 The hex file is here http://www.8051projects.net/forum-t65048-post.html
martinsnc115877
Sun Jul 02 2017, 10:58 AM
sir, sorry for the disturbance I can find the small and capital letter,hex file, please send it to me
Sun Jul 02 2017, 06:15 AM
Sam Raj
Can I have the circuit of Simple Digital Voltmeter using 8051
ExperimenterUK
Sat Jul 01 2017, 08:39 PM
Read this http://www.8051projects.net/forum-t65048-post.html. The project download contains lower case letters. It is compiled in Keil
martinsnc115877
Sat Jul 01 2017, 05:15 PM
I mean scrolling massage display using 8051 by pratrik suthar, the hex file I have is just only the capital letters I need the capital letters and the small letters hex, and I will like to no the compiler name he used for the code thanks
ExperimenterUK
Sat Jul 01 2017, 03:43 PM
@martinsnc115877 which project..link ?

Downloads

Comments

Sarvn
Sat Jul 22 2017, 11:34 AM
diablom
Fri Jul 21 2017, 01:44 PM
Alihaider.007
Thu Jul 20 2017, 03:07 PM
Vijaykumarsharma
Fri Jul 14 2017, 11:08 AM
varma495
Tue Jul 11 2017, 01:55 AM
Ramweit
Sat Jul 08 2017, 01:42 PM
Ben_J1
Fri Jul 07 2017, 04:32 PM
labsdg
Fri Jul 07 2017, 02:58 AM

Online

Guests: 50, Members: 0 ...

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

Members: 37860
Newest member: Sarvn
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 20 2017, 04:08 PM
can it be possible ?? Alihaider.007No.You will nee...
Alihaider.007 Avatar
Posted By Alihaider.007
Thu Jul 20 2017, 03:14 PM
Sir I am using AT89S8253 I have trying to use this...
Utsavi Avatar
Posted By Utsavi
Mon Jul 17 2017, 09:57 AM
Hello Ajay_Bhargav,Thanks for your reply. Yes, you...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:41 AM
I do not think it would be a good idea to kind of ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:32 AM
Tasking EDE has linker script facility available y...
Ramweit Avatar
Posted By Ramweit
Thu Jul 13 2017, 06:58 AM
Thank you for response,Sim300 gsm Modem am using h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jul 11 2017, 04:20 PM
After the SMS is sent the modem should respond+CMG...
Ramweit Avatar
Posted By Ramweit
Tue Jul 11 2017, 02:37 PM
From this code gsm modem sending SMS to mobiles mu...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jul 10 2017, 06:09 PM
@RamweitWhat is it you want to know ?
Ramweit Avatar
Posted By Ramweit
Sat Jul 08 2017, 02:12 PM
#include<reg51.h>#include<stdio.h>bit moreov...