Professional Documents
Culture Documents
AIM:
To interface 7-segment LED display to 8085 microprocessor and write
1) An assembly language program to display the numbers from 0 to 9.
2) An assembly language program to display the numbers from 00 to 99.
APPARATUS REQUIRED:
1)8085 microprocessor kit.
2) 7-segment LED display.
3) IC-7447
4) IC-8255(PPI)
5) Resistors (330 ohms)-8No.s
THEORY:
7-SEGMENT LED DISPLAY:
The seven segment LED display is a multiple display. It can display all decimal digits
and some letters. It is very popular among multiple displays as it has the smallest number of
separate controlled light emitting diodes (LED). Multiple displays of 7-segment LED, 14-segment
LED and dot matrix types are available .These display gives better representation of
alphanumeric characters but require complex circuitry.
In seven segment display there are seven light emitting diodes (LED) as shown above in
the figure. Each LED can be controlled separately. To display a digit or letter the desired segment
are made ON as shown.
There are 2 types of 7 segment display namely, common -cathode type and common anode type.
In a common cathode type display all the 7cathodes of LED s are tied together to the ground.
When a +5 Vdc is applied to any segment, the corresponding diodes emit light. Thus applying
logic '1' (i.e.) positive logic to the desired segments, the desired letter or decimal number can be
displayed. In a common -anode type display all the 7 anodes are tied together and connected to
the +5V supply as shown in the common -anode 7-segment display figure. A particular segment
will emit light when ' 0' logic is applied to it.
The seven segment displays are not connected to I/O ports directly .They are connected
through buffer or drivers/decoders. 7446A, 74L46, 7447 and 74LS47 are decoders/drivers for
common -anode type seven segment displays.
In this experiment we use 7447 decoders for common -anode type seven segment displays.
CALCULATION:
To display a number 0 using single 7 segment display
PA 7
(DOT)
PA 6
PA4
PA3
PA2
PA1
(g)
PA5
(f)
(e)
(d)
(c)
(b)
PA0
(a)
PA6
1
1
0
0
0
0
0
1
0
0
PA5
0
1
0
1
0
0
0
1
0
0
PA4
0
1
0
1
1
1
0
1
0
1
PA3
0
1
0
0
1
0
0
1
0
1
PA2
0
0
1
0
0
0
0
0
0
0
PA1
0
0
0
0
0
1
1
0
0
0
PA0
0
1
0
0
1
0
0
0
0
0
DATA
C0
F9
A4
B0
99
92
82
F8
80
98
Machine
code
3E,80
Label
Mnemonics
Comment
MVI A, 80
4302
D3,0F
4304
21,00,42
4307
06,0A
4309
7E
430A
430C
430F
D3,0C
CD,17,43
23
OUT 0C
CALL Delay
INX H
4310
4311
4314
4317
05
C2,09,43
C3,04,43
0E,02
Delay
DCR B
JNZ Loop1
JMP Loop2
MVI C, 02
4319
11,00,FA
Loop4
LXI D, FA00
431C
1B
Loop3
DCX D
431D
7B
MOV A,E
431E
B2
ORA D
431F
4322
C2,1C,43
0D
JNZ Loop3
DCR C
4323
4326
C2,19,43
C9
JNZ Loop4
RET
OUT 0F
Loop 2
LXI H,4200
MVI B,0A
Loop 1
MOV A,M
Machine code
Label
Mnemonics
Comment
3E,80
MVI A,80
4302
D3,0F
OUT 0F
4304
4306
4308
430B
3E,00
D3,0C
CD,15,43
3C
430C
27
DAA
430D
FE,00
CPI 00
430F
C2,06,43
JNZ Loop1
4312
4315
C3,04,43
06,FF
Delay
JMP Loop2
MVI B,FF
4317
0E,FF
Loop3
MVI C,FF
4319
431A
OD
C2,19,43
Loop4
DCR C
JNZ Loop4
431D
431E
05
C2,17,43
DCR B
JNZ Loop3
4321
C9
RET
Move data FF to C
register
Decrement C register
Jump on no zero to
loop4
Decrement B register
Jump on no zero to loop
3
Return to main program.
Result:
Thus 7-segment LED display is interfaced with 8085 microprocessor kit using 8085 and
assembly language programs are written
i) To display the numbers from 0 to 9.
ii) To display the numbers from 00 to 99.
PROGRAM
Memory Machine code
Location
4300
3E,80
4302
D3,0F
4304
4306
4308
430B
430D
430F
4312
4315
4317
4318
431B
3E,FF
D3,0C
CD,15,43
3E,00
D3, 0C
CD,15,43
C3,04,43
06,6C
05
C3,17,43
C9
Label
Mnemonics
MVI A,80
Comment
Rectangular waveform
Theory: The rectangular waveform of frequency 1 KHz with 60% duty cycle can be generated by
sending logic 1 and logic 0 for a delay of 0.6msec and 0.4msec respectively on the selected port
pin. The port A of 8255 (PPI) can be used in output mode and one of the port A pins can be made
high and low consecutively with a delay of 0.6msec and 0.4msec to generate a rectangular
waveform of frequency 1KHz. For that the data 00H and 01H have to be sent to PA0 with the
required delay..
The delay calculation: To generate a delay of 0.6msec.
The delay program is as shown below.
MVI B, Count
LOOP
DCR B
JNZ LOOP
RET
The approximate delay = 14N10.3310-6 =0.610-3
N1=130=(82)16
PROGRAM
Memory Machine
Location code
4300
3E,80
4302
D3,0F
4304
4306
4308
430B
430D
430F
4312
4315
4317
4318
431B
431C
431E
431F
4322
3E,FF
D3,0C
CD,15,43
3E,00
D3, 0C
CD,15,43
C3,04,43
06,82
05
C3,17,43
C9
06,57
05
C3,1E,43
C9
Label
Mnemonics
Comment
MVI A,80
OUT 0F
LOOP
DELAY1
LOOP1
DELAY2
LOOP2
MVI A ,FF
OUT 0C
CALL Delay1
MVI A ,00
OUT 0C
CALL Delay2
JMP LOOP
MVI B,82
DCR B
JNZ LOOP1
RET
MVI B,57
DCR B
JNZ LOOP2
RET
Result: Thus assembly language programs were written to generate square and rectangular
waveforms and tested.