►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

Fri Aug 29 2014, 12:17 AM
sufiyan
please can you tell me which type of lock activator should i connect in place of LED? can i use selenoid lock actuator
ajay_bhargav
Thu Aug 28 2014, 06:34 AM
Please post questions in forum
Thu Aug 28 2014, 01:44 AM
yednekachew
can you give a project made bay proteus software
Mon Aug 25 2014, 07:12 AM
Vinod Soni
Hi Sir, How can i make this RFID with ATMega16/32 controller
pavanjain
Sat Aug 23 2014, 05:10 AM
Sir i want to download the hex file in P89v51rd2 microcontroller using max232 IC but we not load the program in IC
Tue Aug 19 2014, 04:51 PM
allen ndumu
please i will like to know if the problem of speed control of dc motor using keypad and l298 was if yes can i have the complete project send it to the address i really need to see it
Tue Aug 19 2014, 10:47 AM
Amit Bisht
sir i want to have some trending projects on which i could work related to ATmega 16 microcontroller
ExperimenterUK
Sat Aug 16 2014, 04:16 PM
@diligent . create a thread
Sat Aug 16 2014, 03:17 PM
diligent
in assembly langauage programming..
Sat Aug 16 2014, 03:14 PM
diligent
will anyone help me?

Downloads

Comments

enisi
Wed Aug 27 2014, 06:08 AM
sadalakshmi
Wed Aug 27 2014, 12:39 AM
Paecake
Sun Aug 24 2014, 04:07 PM
pavanjain
Sat Aug 23 2014, 02:33 AM
samchovatiya
Thu Aug 21 2014, 02:30 PM
hasmukhjain
Wed Aug 20 2014, 06:28 AM
rablo
Tue Aug 19 2014, 10:10 AM
faizhameed
Tue Aug 12 2014, 10:39 PM

Online

Guests: 48, Members: 0 ...

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

Members: 37501
Newest member: enisi
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Aug 28 2014, 03:31 PM
So, I don't think there is any need to load any da...
ajay_bhargav Avatar
Posted By ajay_bhargav
Thu Aug 28 2014, 06:33 AM
Did your professor ask this question to you? I sug...
siddique Avatar
Posted By siddique
Thu Aug 28 2014, 01:09 AM
hi,In the Tx code, I have disabled auto acknowledg...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Aug 27 2014, 04:59 PM
Your board has two serial ports, are you connectin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Aug 27 2014, 04:45 PM
In your TX code I see where you set payload width ...
enisi Avatar
Posted By enisi
Wed Aug 27 2014, 07:05 AM
It can be more than one ansawer correctly
enisi Avatar
Posted By enisi
Wed Aug 27 2014, 06:57 AM
Port 0 is connected indicator 7 segments, so that ...
siddique Avatar
Posted By siddique
Wed Aug 27 2014, 01:48 AM
Pls check the Tx and Rx functions have made some c...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Aug 26 2014, 06:03 PM
I assume you have made the changes I suggested to ...
siddique Avatar
Posted By siddique
Tue Aug 26 2014, 03:20 AM
Hi,Tried your suggestions.when i put the device in...