Here u can find diagram and code of the project..
source code:
ORG 0000H
START: MOV R0,#30H //ram address
MOV R6,#4 //counter
MOV A,#38H
ACALL COMMAND
ACALL DELAY
MOV A,#0EH
ACALL COMMAND
ACALL DELAY
MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#06H
ACALL COMMAND
ACALL DELAY
MOV A,#80H
ACALL COMMAND
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#0C0H
ACALL COMMAND
ACALL DELAY
SJMP KEY
COMMAND: MOV P1,A
CLR P3.0
CLR P3.1
SETB P3.2
ACALL DELAY
CLR P3.2
RET
DATAWRT: MOV P1,A
SETB P3.0
CLR P3.1
SETB P3.2
ACALL DELAY
CLR P3.2
RET
DELAY:MOV R5,#25
HERE1: MOV R4,#255
HERE2:DJNZ R4,HERE2
DJNZ R5,HERE1
RET
KEY: MOV P2,#0FFH
K1:MOV P0,#0
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,K1
K2:ACALL DELAY
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,OVER
SJMP K2
OVER:ACALL DELAY
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,OVER1
SJMP K2
OVER1:MOV P0,#11111110B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_0
MOV P0,#11111101B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_1
MOV P0,#11111011B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_2
MOV P0,#11110111B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_3
LJMP K2
ROW_0:MOV DPTR,#KCODE0
SJMP FIND
ROW_1:MOV DPTR,#KCODE1
SJMP FIND
ROW_2:MOV DPTR,#KCODE2
SJMP FIND
ROW_3:MOV DPTR,#KCODE3
SJMP FIND
FIND:RRC A
JNC MATCH
INC DPTR
SJMP FIND
MATCH:
CLR A
MOVC A,@A+DPTR
MOV @R0,A
MOV A,#'*'
ACALL DATAWRT
ACALL DELAY
INC R0
DJNZ R6,K1
LJMP PASS
ORG 500H
KCODE0:DB '1','2','3'
KCODE1:DB '4','5','6'
KCODE2:DB '7','8','9'
KCODE3:DB '*','0','#'
PASS:MOV R3,#'5'
MOV R0,#30H
MOV A,@R0
INC R0
CJNE A,#'2',A1
INC R3
SJMP N1
A1:DEC R3
N1:MOV A,@R0
INC R0
CJNE A,#'5',A2
INC R3
SJMP N2
A2:DEC R3
N2:MOV A,@R0
INC R0
CJNE A,#'8',A3
INC R3
SJMP N3
A3:DEC R3
N3:MOV A,@R0
INC R0
CJNE A,#'0',A4
INC R3
SJMP N4
A4:DEC R3
N4:MOV A,R3
CJNE A,#'9',NOTMA
LCALL MATCHED
NOTMA:LCALL NOTMATCH
MATCHED:MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'M'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'H'
ACALL DATAWRT
ACALL DELAY
CLR P2.4
MOV R7,200
MDELAY: ACALL DELAY
DJNZ R7,MDELAY
SETB P2.4
MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'I'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'0'
ACALL DATAWRT
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#'.'
ACALL DATAWRT
ACALL DELAY
AG: SJMP AG
NOTMATCH:MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'G'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV R7,#50
LD: ACALL DELAY
DJNZ R7,LD
LJMP START
END
source code:
ORG 0000H
START: MOV R0,#30H //ram address
MOV R6,#4 //counter
MOV A,#38H
ACALL COMMAND
ACALL DELAY
MOV A,#0EH
ACALL COMMAND
ACALL DELAY
MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#06H
ACALL COMMAND
ACALL DELAY
MOV A,#80H
ACALL COMMAND
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#0C0H
ACALL COMMAND
ACALL DELAY
SJMP KEY
COMMAND: MOV P1,A
CLR P3.0
CLR P3.1
SETB P3.2
ACALL DELAY
CLR P3.2
RET
DATAWRT: MOV P1,A
SETB P3.0
CLR P3.1
SETB P3.2
ACALL DELAY
CLR P3.2
RET
DELAY:MOV R5,#25
HERE1: MOV R4,#255
HERE2:DJNZ R4,HERE2
DJNZ R5,HERE1
RET
KEY: MOV P2,#0FFH
K1:MOV P0,#0
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,K1
K2:ACALL DELAY
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,OVER
SJMP K2
OVER:ACALL DELAY
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,OVER1
SJMP K2
OVER1:MOV P0,#11111110B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_0
MOV P0,#11111101B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_1
MOV P0,#11111011B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_2
MOV P0,#11110111B
MOV A,P2
ANL A,#00000111B
CJNE A,#00000111B,ROW_3
LJMP K2
ROW_0:MOV DPTR,#KCODE0
SJMP FIND
ROW_1:MOV DPTR,#KCODE1
SJMP FIND
ROW_2:MOV DPTR,#KCODE2
SJMP FIND
ROW_3:MOV DPTR,#KCODE3
SJMP FIND
FIND:RRC A
JNC MATCH
INC DPTR
SJMP FIND
MATCH:
CLR A
MOVC A,@A+DPTR
MOV @R0,A
MOV A,#'*'
ACALL DATAWRT
ACALL DELAY
INC R0
DJNZ R6,K1
LJMP PASS
ORG 500H
KCODE0:DB '1','2','3'
KCODE1:DB '4','5','6'
KCODE2:DB '7','8','9'
KCODE3:DB '*','0','#'
PASS:MOV R3,#'5'
MOV R0,#30H
MOV A,@R0
INC R0
CJNE A,#'2',A1
INC R3
SJMP N1
A1:DEC R3
N1:MOV A,@R0
INC R0
CJNE A,#'5',A2
INC R3
SJMP N2
A2:DEC R3
N2:MOV A,@R0
INC R0
CJNE A,#'8',A3
INC R3
SJMP N3
A3:DEC R3
N3:MOV A,@R0
INC R0
CJNE A,#'0',A4
INC R3
SJMP N4
A4:DEC R3
N4:MOV A,R3
CJNE A,#'9',NOTMA
LCALL MATCHED
NOTMA:LCALL NOTMATCH
MATCHED:MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'M'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAY
MOV A,#'H'
ACALL DATAWRT
ACALL DELAY
CLR P2.4
MOV R7,200
MDELAY: ACALL DELAY
DJNZ R7,MDELAY
SETB P2.4
MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'I'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'0'
ACALL DATAWRT
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV A,#'.'
ACALL DATAWRT
ACALL DELAY
AG: SJMP AG
NOTMATCH:MOV A,#01H
ACALL COMMAND
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAY
MOV A,#'G'
ACALL DATAWRT
ACALL DELAY
MOV A,#' '
ACALL DATAWRT
ACALL DELAY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAY
MOV A,#'A'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'S'
ACALL DATAWRT
ACALL DELAY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAY
MOV A,#'R'
ACALL DATAWRT
ACALL DELAY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAY
MOV R7,#50
LD: ACALL DELAY
DJNZ R7,LD
LJMP START
END
No comments:
Post a Comment