►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

ExperimenterUK
Sun Mar 01 2015, 07:06 AM
@Anupam Biswas..post all you have done in the GSM forum
Sat Feb 28 2015, 02:51 PM
Anupam Biswas
I am doinga project on gsm based home automation.I have done alittle study about at commands.I am using Atmel 89c51 with yhe gsm module.I am unable to receive any message via the module.The simulation is done on proteus and i am using a virtual terminal.Can anyone please help me?Thanks in advance.
Tue Feb 24 2015, 12:47 AM
MrCurious
is Stat a global variable too? you reference it in Chan's "disk_status" function.
Sat Feb 21 2015, 09:10 PM
Harikumar
കൊള്ളാം
ExperimenterUK
Fri Feb 20 2015, 06:28 AM
@sugikz.. I have asked Ajay about it, he'll soon sort it out
Thu Feb 19 2015, 12:22 PM
sugikz
"Sorry no bots allowed! You entered two different email addresses. Please enter a valid email address in the two fields provided"
Thu Feb 19 2015, 12:21 PM
sugikz
this are the problem notice box;
Thu Feb 19 2015, 12:20 PM
sugikz
yes, i still got stuck on email problem, i've used gmail, yahoo, and told some friends of mine to sign up on the site, but they face the same problem as iam,
Thu Feb 19 2015, 05:48 AM
sjeeva
hi, is any doing a project on raspberry pi
Thu Feb 19 2015, 05:48 AM
sjeeva
hi

Downloads

Comments

MALIKATIF
Mon Mar 02 2015, 04:47 PM
raamchandran
Mon Mar 02 2015, 11:20 AM
ABiDAEV
Sat Feb 28 2015, 11:31 PM
arunkollam
Wed Feb 25 2015, 05:28 AM
sugikz11
Wed Feb 25 2015, 04:23 AM
Buhari
Sun Feb 22 2015, 03:16 PM
Jarvis_v3
Sat Feb 21 2015, 02:00 AM
Sontoloyo
Thu Feb 19 2015, 12:50 PM

Online

Guests: 40, Members: 0 ...

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

Members: 37591
Newest member: MALIKATIF
Forum Activity
ABiDAEV Avatar
Posted By ABiDAEV
Sun Mar 01 2015, 11:42 AM
Thanks for sharing, but can you please update the ...
sankalp_s Avatar
Posted By sankalp_s
Thu Feb 26 2015, 09:27 PM
What are you trying to make ?ExperimenterUKsir i w...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Feb 26 2015, 12:58 AM
We seem to be moving away from the original projec...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Feb 25 2015, 02:02 PM
You will need a 64 bytes buffer that will be writt...
PsySc0rpi0n Avatar
Posted By PsySc0rpi0n
Wed Feb 25 2015, 09:24 AM
I've already read that tutorial and almost all oth...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Feb 25 2015, 04:56 AM
brightness control is going to be tough job as you...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Feb 25 2015, 04:36 AM
I've already read that tutorial and almost all oth...
sankalp_s Avatar
Posted By sankalp_s
Tue Feb 24 2015, 07:18 PM
The attached code is for up to 16 LEDs.Just point ...
sankalp_s Avatar
Posted By sankalp_s
Tue Feb 24 2015, 07:16 PM
sankalp_s Avatar
Posted By sankalp_s
Tue Feb 24 2015, 07:12 PM