►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

sachinmm
Sat Jun 27 2015, 05:01 AM
how calculate 1 second delay in 8051 by using timer and what value should be store in TH0 & TLO register??
sachinmm
Fri Jun 26 2015, 08:25 AM
hello sir plz tell me how to know the 74HC165 parallel in serial out ic is fauty or not?
Wed Jun 24 2015, 08:24 AM
ben mutuku
How can one use XOR gate to ensure the first output is '1' and the next is '0'?
ExperimenterUK
Wed Jun 17 2015, 01:37 AM
@baz..try adding a hash and a semi colon
Sun Jun 14 2015, 06:31 AM
baz
@ExperimenterUK no..i dont do that i just type message example.. Hello my name is baz and then i click send message,
ExperimenterUK
Sun Jun 14 2015, 01:55 AM
@baz..did you end your message with a hash and a semi colon
Sat Jun 13 2015, 06:48 PM
asif Jamadar
I want the program for v/f control technique of 3 phase induction motor
Sat Jun 13 2015, 07:06 AM
baz
@ExperimenterUK okay thank you...but now I already complete and my dot matrix already light up but when i send message from pc to my hardware project it doesnt show any message on my dot matrix..its only blinking when i click send message....I really dont know whats the problem...I had follow all the steps...schematic and use the coding that have been provided..is it because firstly i had wrong burn the coding in AT24C16?? Is that effect ????
ExperimenterUK
Sat Jun 13 2015, 12:08 AM
@baz Load the hex file into the at89c52, The at24c16 holds the message to display
Fri Jun 12 2015, 02:21 PM
Birhane
Bidirectional Visitor Counter

Downloads

Comments

Mc_Comet32
Thu Jun 25 2015, 11:42 AM
yashaswi
Thu Jun 25 2015, 05:56 AM
Riki-cc
Tue Jun 23 2015, 10:48 AM
PadRlp
Thu Jun 18 2015, 02:11 PM
start
Thu Jun 18 2015, 01:30 PM
sheilabajos
Tue Jun 09 2015, 03:35 PM
martintan
Tue Jun 09 2015, 12:08 AM
karra.vnr
Tue Jun 02 2015, 03:41 PM

Online

Guests: 28, Members: 0 ...

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

Members: 37671
Newest member: Mc_Comet32
Forum Activity
Amit Kumar Das Avatar
Posted By Amit Kumar Das
Mon Jun 29 2015, 06:03 PM
Suppose the ILI9320 TFT LSB & MSB pins are con...
prajwalsnh Avatar
Posted By prajwalsnh
Mon Jun 29 2015, 03:39 PM
Hello everyone,I wanted to know the basics of debu...
prajwalsnh Avatar
Posted By prajwalsnh
Mon Jun 29 2015, 03:28 PM
Hello all,I wanted to know which is the default co...
vipinpathakg Avatar
Posted By vipinpathakg
Sun Jun 28 2015, 12:57 AM
Three letters E,Z and I displaying completely but...
pravin_35 Avatar
Posted By pravin_35
Sat Jun 27 2015, 06:19 AM
Thanks ajay and Exp uk...i thought of getting Micr...
sachinmm Avatar
Posted By sachinmm
Sat Jun 27 2015, 05:09 AM
how calculate 1 second delay in 8051 by using time...
mayank058 Avatar
Posted By mayank058
Fri Jun 26 2015, 10:00 AM
dear Sir, This program is working on ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jun 25 2015, 08:34 PM
If the display is showing something, it sounds lik...
vipinpathakg Avatar
Posted By vipinpathakg
Thu Jun 25 2015, 03:01 PM
After uploading message via USB to RS232 adapter m...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 23 2015, 05:31 PM
I like the PCW compiler from http://www.ccsinfo.co...