Aim-To Display 0 To 9 On The Seven Segment Using 8051

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

EXPERIMENT -3

AIM- TO DISPLAY 0 TO 9 ON THE SEVEN SEGMENT USING 8051


SIMULATOR
SIMULATOR USED- Edsim51Ddi-version2.1.23
PROGRAM CODE:-
ORG 20H ; start the program from 20h address
MOV R5, #0AH; load 0AH in R5 for initialization of counter as we want
to display the number from 0 to 9 so we need counter value to be 10
MOV DPTR, #80H ; load DPTR with the address of lookup table for
codes of displaying to 0 to 9 on seven segment
AGAIN: CLR A; reset THE accumulator
MOVC A, @A+DPTR ; load the content of location @ A+DPTR in A
MOV P1, A; load the accumulator digits to port 1 to display digit on
segment.
INC DPTR; increment DPTR for next digit code in lookup table
1CALL DELAY; call delay function
DJNZ R5, AGAIN; if R5 not zero(all digit not displayed)then go to anther
level to displaying the next digit of lookup table
DELAY: MOV R7, #10; loop for delay between digits.
START: DJNZ R1, START ; jump to start until R7 is not equal to zero
RET
ORG 80H ;
DB 0C0H,,OF9H, 0A4H, 0B0H, 99H,92H,82H, 0F8H,80H, 98H
; code for each digit number from 0 to 9. END;
EXPERIMENT -3

CIRCUIT DIAGRAM:-
EXPERIMENT -3

OUTPUT SCREENSHOT:-
EXPERIMENT -3

CONCLUSION :- Here all digits are displayed from 0 to 9 on the seven


segment successfully , with time delay between two digits.

You might also like