Practical:-11 Date:-: Aim: Theory
Practical:-11 Date:-: Aim: Theory
Aim:
Date:-
Write a program to interface 7 segment with 8051 to display 0000h to ffffh. simultaneously on 7 segment and draw interface diagram.
Theory
Seven-Segment Display Interfacing
To display numerical values, seven-segment displays are used widely. They may be seen in clocks and electronic measuring instruments. A few upper and lower case alphabets may also be displayed through it. Seven-segment displays are combination of eight LEDs, either in common anode Fig or in common cathode Fig formation. As shown in Fig the segments are designated as a, b, c, d, e, f and g and the last or eighth one representing the decimal dot is designated as p. As only seven of its segments are used to display any numeric value, hence the name seven segment.
DATA
D7 D6 D5 D4 D3 D2 D1 D0 h g f e d c b a
CODE
0 1 2 3 4 5 6 7 8 9 A B C D E F
1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 1 0 1 0 1 0
0 0 1 1 1 0 1 1 0 1 0 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0
0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 1
0 0 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0
C0 F9 A4 B0 99 92 82 F8 80 90 88 83 C6 A1 86 8e
Program:
org 00h sjmp l1 org 30h l1: mov p0,#00h mov dptr,#3000h mov r0,#0fh l2: clr a movc a,@a+dptr mov p0,a acall delay inc dptr djnz r0,l2 sjmp l1 delay: mov r1,#10h l4: l3: mov r2,#50h djnz r2,l3 djnz r1,l4 ret org 3000h db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h,83h,0c6h,0a1h,86h,8eh end