INTERFACING OF SEVEN-SEGMENT DISPLAY TO 8051

 6.1 Introduction

One common requirement for many different digital devices is a visual numeric display. Individual LEDs can of course display the binary states of a set of latches or flip-flops. However, we're far more used to thinking and dealing with decimal numbers. To this end, we want a display of some kind that can clearly represent decimal numbers without any requirement of translating binary to decimal or any other format. One possibility is a matrix of 28 LEDs in a 7×4 array. 
                    

We can then light up selected LEDs in the pattern required for whatever character we want. Indeed, an expanded version of this is used in many ways, for fancy displays. However, if all we want to display is numbers, this becomes a bit expensive. A much better way is to arrange the minimum possible number of LEDs in such a way as to represent only numbers in a simple fashion. This requires just seven LEDs (plus an eighth one for the decimal point, if that is needed). A common technique is to use a shaped piece of translucent plastic to operate as a specialized optical fiber, to distribute the light from the LED evenly over a fixed bar shape. The seven bars are laid out as a squared-off figure "8". The result is known as a seven-segment LED. We've all seen seven-segment displays in a wide range of applications. Clocks, watches, digital instruments, and many household appliances already have such displays. In this experiment, we'll look at what they are and how they can display any of the ten decimal digits 0-9 on demand Seven segments display a single character.Seven segments Display commonly contains LED segments arranged as an 8 with one common Lead that is either anode or cathode and seven individual leads for its segment. Figure shows the pattern and equivalent circuit representation of common cathode display. If more than one display is to be used then they can be time-multiplexed. The human eye cannot detect the blinking if each display is relit every 10ms or so. The 10ms is divided by number of displays used to find intervals between updating each display.
6.2 Schematic Diagram

As shown in the schematic diagram , the LEDs in a seven-segment display are not isolated from each other. Rather, either all of the cathodes, or all of the anodes, are connected together into a common lead, while the other end of each LED is individually available. This means fewer electrical connections to the package, and also allows us to easily enable or disable a particular digit by controlling the common lead. (In some cases, the common connections are made to groups of LEDs, and the external wiring must make the final connections between them. In other cases, the common connection is made available at more than one location for convenience in laying out printed circuit boards. When laying out circuits using such devices, you simply need to take the specific connection details into account.) There is no automatic advantage of the common-cathode seven-segment unit over the common-anode version, or vice-versa. Each type lends itself to certain applications, configurations, and logic families. We'll learn more about this in later experiments. For the present, we will use a common-cathode display as our experimental example.
6.3 Seven-Segment Display Layout
The illustration to the right shows the basic layout of the segments in a seven segment display. The segments themselves are identified with lower-case letters "a" through "g," with segment "a" at the top and then counting clockwise. Segment "g" is the center bar. Most seven-segment digits also include a decimal point ("dp”) and some also include an extra triangle to turn the decimal point into a comma. This improves readability of large numbers on a calculator, for example. The decimal point is shown here on the right, but some display units put it on the left, or have a decimal point on each side. In addition, most displays are actually slanted a bit, making them look as if they were in italics. This arrangement allows us to turn one digit upside down and place it next to another, so that the two decimal points look like a colon between the two digits. The technique is commonly used in LED clock displays. Seven-segment displays can be packaged in a number of ways. Three typical packages are shown above. On the left we see three small digits in a single 12-pin DIP package. The individual digits are very small, so a clear plastic bubble is molded over each digit to act as a magnifying lens. The sides of the end bubbles are flattened so that additional packages of this type can be placed end-to-end to create a display of as many digits as may be needed. The second package is essentially a 14-pin DIP designed to be installed vertically. Note that for this particular device, the decimal point is on the left. This is not true of all seven-segment displays in this type of package. One limitation of the DIP package is that it cannot support larger digits. To get larger displays for easy reading at a distance, it is necessary to change the package size and shape. The package on the right above is larger than the other two, and thus can display a digit that is significantly larger than will fit on a standard DIP footprint. Even larger displays are also available; some digital clocks sport digits that are two to five inches tall. Seven-segment displays can be constructed using any of a number of different technologies. The three most common methods are fluorescent displays (used in many line-powered devices such as microwave ovens and some clocks and clock radios), liquid crystal displays (used in many battery-powered devices such as watches and many digital instruments), and LEDs (used in either line-powered or battery powered devices). However, fluorescent displays require a fairly high driving voltage to operate, and liquid crystal displays require special treatment that we are not yet ready to discuss. Therefore, we will work with a seven segment LED display in this experiment.

6.4 HARDWARE CRITERIA:
Multiplex seven segment display when there is need of more than one seven segment they can be time multiplexed. In the connection segment information is output on any port of 89c51 and the cathode selection is done by port pins. Transistor must be used to handle the currents required by the led’s, typically 10 mill amperes for each segment and 70 milliamperes for each cathode. These are average current values, the peak currents will be four times as high for the 2.5 milliseconds each display is illuminated. In multiplexed segment transistors are required as number of segments. Enable lines also required as much as segments, high logic on any of the one port pins select the segment. All data lines or segment lines of different segments are shorted first. As an segment line “a” of the for first segment is shorted with all segments’ line a. Finally for any number of segments there are eight segment lines. Each of the segment is selected by the enable lines connected to port pins by transistor. At ones only one segment can be lit.
Advantage of this kind of connection or multiplexing is the minimum use of port pins. For two segments no need of 16 port pins but only 8 pins required. The difference is only time multiplexing. All segments not lit at ones but time between two is hardly observed by human eyes. That’s why it is more in use.

Inter facing of four multiplexed seven segment to 89c51

Figure:
As key is pressed using look up table scan code is given to segment and character or number is displayed. Only difference is that segment lit one by one. Non multiplexed seven segment
Here more than one segment can be used but they are not multiplexed. At once multiple segments lit and no time sharing between two segments. In short, segment lines a,b,c…..dp of different segments are not shorted. For connection of two segments 16 segment lines (8 per one)



are required. Controller has not so much port pins to effort. Due to lack of port pins or saving the pins multiplexing is the better choice over non multiplexing. Only advantage is many segments can be lit at a time. Here we show connection of single seven segments to controller. Keyboard is input device and display is output device. If switch is pressed on keyboard after detecting which key is pressed, we get scan code (a pattern of zero’s and one’s to which can lit a segment and form a character or digit) using look up table. This pattern is given to segment lines appropriate digit according to key is displayed on segment. To enable segment one port pin is used to which (we use pnp transistor and common cathode) transistor base is connected and emitter is grounded While collector is connected to segment. For common anode and npn transistor connection is reversed This is example of single seven segment. For non multiplex another segment is connected to remaining eight port pins.

6.5 Program to Display from 0-9 on one seven segment

#include<reg51.h>
unsigned char array[10]={0xbf,0x86,0xdb,0xcf,0xe6,0xed,0xfd,0x87,0xff,0xef};
void delay();
void main()
{
int a;
while(1)
{
P2=0x08;
for(a=0;a<=9;a++)
{
P0=array[a];
delay();
}
}
}
void delay()
{
int i;
for(i=0;i<=30000;i++);
{
}
}



















Comments

Popular posts from this blog

AUDIO SPOTLIGHTING

Electronic Reconnaissance, ELECTRONIC COUNTERMEASURES (ECM), ELECTRONIC COUNTER-COUNTERMEASURES (ECCM)

INTERFACING OF EEPROM with 8051