MicroprocessorandMicrocontrollerSessional
Experiment No. 03: Interfacing of Seven Segment Display with MDA-8086 Microprocessor
Objectives: The objectives of this experiment are-
a) To interface Seven Segment Display with 8086 microprocessor by 8255 PPI
b) Internal connection of 8255 PPI with 8086 microprocessor for Seven
Segment Display.
Theory:
The 7-segment display, also written as “seven segment display”, consists of seven LEDs (hence its
name) arranged in a rectangular fashion as shown. Each of the seven LEDs is called a segment
because when illuminated the segment forms part of a numerical digit (both Decimal and Hex) to be
displayed. An additional 8th LED is sometimes used within the same package thus allowing the
indication of a decimal point, (DP) when two or more 7-segment displays are connected together to
display numbers greater than ten.
Common Anode and Common Cathode 7-segment Display
The Common Cathode (CC) – In the common cathode display, all the cathode connections of the
LED segments are joined together to logic “0” or ground. The individual segments are illuminated
by application of a “HIGH”, or logic “1” The Common Anode (CA) – In the common anode
display, all the anode connections of the LED segments are joined together to logic “1”. The
individual segments are illuminated by applying a ground, logic “0” or “LOW”
1
Connection Diagram:
Figure 1: Pin diagram and Connection of 8255
2
Figure 2: LED Connection
Port Connection Bus :
18H~ 1FH 8255A- CS1/ 8255A-CS1(DOT & ADC INTERFACE)
8255A-CS2 18H: A PORT DATA REGISTER
1AH:B PORT DATA REGISTER
1CH:C PORT CONTROL REGISTER
8255-CS2(LED & STEPPING MOTOR)
19H:A PORT DATA REGISTER
1BH : B PORT DATA REGISTER
1DH : C PORT CONTROL REGISTER
1FH : CONTROL REGISTER
3
Control Word for LED Interfacing:
D7 D6 D5 D4 D3 D2 D1 D0 Control
word
If D7=0, BSR Mode If D7=1, I/O Mode
Mode 0 Mode 1 Mode 2
4
Instructions/Program:
CODE SEGMENT
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
;
PPIC_C EQU 1FH
PPIC EQU 1DH
PPIB EQU 1BH
PPIA EQU 19H
;
ORG 1000H
MOV AL,10000000B
OUT PPIC_C,AL
MOV AL,11111111B
OUT PPIA, AL
;
L1: MOV AL,010000000B
OUT PPIA,AL
CALL DELAY
MOV AL,11111001B
OUT PPIA,AL
CALL DELAY
JMP L1
DELAY: MOV CX,1111111111111111B
TIMER1: NOP
5
NOP
NOP
NOP
LOOP TIMER1
RET
;
CODE ENDS
END
ExperimentProcedures:
1. Turnonthe8086microprocessorkit
2. Writethecodesin theMDA Winide-8086 compiler software
3. Press the load button (AL) in MDA winide-8086 Software
4. To execute the program press G in Terminal Windows then press Enter button.
Home Work:
1. Create a new code that will display the digits 0 to 9 on seven segment display.
Reference Book:
Assembly Language programming and Organization of the IBM
PC By Ytha Yu and Charles Marut