Rushdiey
Junior Member level 2
- Joined
- Jan 10, 2013
- Messages
- 24
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,419
EN EQU P1.1
RW EQU P1.3
RS EQU P1.2
DP1 EQU P3.0
ORG 00H
START: ACALL DELAY
MOV R5,#28H
ACALL COMMAND
MOV R5,#0EH
ACALL COMMAND
MOV R5,#01H
ACALL COMMAND
MOV R5,#06H
ACALL COMMAND
MOV R5,#80H
ACALL COMMAND
;MOV R5,#7
;LOOP: ; ACALL TULIS
MOV R5,#80H
ACALL COMMAND
MOV R5,#'S'
ACALL TULIS
MOV R5,#82H
ACALL COMMAND
MOV R5,#'A'
ACALL TULIS
MOV R5,#84H
ACALL COMMAND
MOV R5,#'Y'
ACALL TULIS
MOV R5,#86H
ACALL COMMAND
MOV R5,#'A'
ACALL TULIS
MOV R5,#0C1H
ACALL COMMAND
MOV R5,#'C'
ACALL TULIS
;DJNZ R5,LOOP
; MOV R5,#9
; ACALL TULIS
HERE: SJMP HERE
MOV DPTR,#0150H
;MOV R1,#0
NEXT_CHAR: MOV A,#0
MOVC A,@A+DPTR
JZ STRING_END
;ACALL DELAY
MOV R5,A
ACALL TULIS
INC DPTR
AJMP NEXT_CHAR
STRING_END: SJMP $
CLOCK: SETB EN
ACALL DELAY_INIT
CLR EN
ACALL DELAY_INIT
NOP
RET
TULIS: MOV A,R5
;ORL A,#30H
ANL A,#0F0H
MOV P1,A
SETB RS
CLR RW
ACALL CLOCK
MOV A,R5
; ORL A,#30H
SWAP A
MOV P1,A
SETB RS
CLR RW
ACALL CLOCK
RET
COMMAND: MOV A,R5
ANL A,#0F0H
MOV P1,A
CLR RS
CLR RW
ACALL CLOCK
MOV A,R5
SWAP A
MOV P1,A
CLR RS
CLR RW
ACALL CLOCK
RET
DELAY: MOV R7,#0FFH
DEL: NOP
NOP
DJNZ R7,DEL
RET
DELAY_INIT: MOV R7,#0FFH
DEL1: NOP
NOP
NOP
NOP
NOP
NOP
NOP
DJNZ R7,DEL1
STOP: RET
ORG 0150H
TABLE: DB ' ',0
END
EN EQU P1.1
RW EQU P1.3
RS EQU P1.2
DP1 EQU P3.0
ORG 00H
START: ACALL DELAY
MOV R5,#28H
ACALL COMMAND
MOV R5,#0EH
ACALL COMMAND
MOV R5,#01H
ACALL COMMAND
MOV R5,#06H
ACALL COMMAND
MOV R5,#80H
ACALL COMMAND
;MOV R5,#9
;DJNZ R5,LOOP
;MOV R5,#82H
;ACALL COMMAND
;MOV R5,#9
;ACALL TULIS
;MOV R5,#0C0H
;ACALL COMMAND
;MOV R4,#'A'
;ACALL HURUF
;LOOP:
MOV P3,#0F0H
SCAN: MOV P3,#0FEH
JB P3.4, NEXT1;0
JNB P3.4, $
MOV R5,#'0'
ACALL TULIS
JMP SCAN
NEXT1: JB P3.5, NEXT2;1
JNB P3.5, $
MOV R5,#'4'
ACALL TULIS
JMP SCAN
NEXT2: JB P3.6, NEXT3;2
JNB P3.6, $
MOV R5,#'8'
ACALL TULIS
JMP SCAN
NEXT3: JB P3.7, NEXT4;3
JNB P3.7, $
MOV R5,#'C'
ACALL TULIS
JMP SCAN
NEXT4: MOV P3,#0FDH
JB P3.4, NEXT11;4
JNB P3.4, $
MOV R5,#'1'
ACALL TULIS
JMP SCAN
NEXT11: JB P3.5, NEXT12;5
JNB P3.5, $
MOV R5,#'5'
ACALL TULIS
JMP SCAN
NEXT12: JB P3.6, NEXT13;6
JNB P3.6, $
MOV R5,#'9'
ACALL TULIS
JMP SCAN
NEXT13: JB P3.7, NEXT14;7
JNB P3.7, $
MOV R5,#'D'
ACALL TULIS
JMP SCAN
NEXT14: MOV P3,#0FBH
JB P3.4, NEXT21;8
JNB P3.4, $
MOV R5,#'2'
ACALL TULIS
JMP SCAN
NEXT21: JB P3.5, NEXT22;9
JNB P3.5, $
MOV R5,#'6'
ACALL TULIS
JMP SCAN
NEXT22: JB P3.6, NEXT23;A
JNB P3.6, $
MOV R5,#'A'
ACALL TULIS
JMP SCAN
NEXT23: JB P3.7, NEXT24;B
JNB P3.7, $
MOV R5,#'E'
ACALL TULIS
JMP SCAN
NEXT24: MOV P3,#0F7H
JB P3.4, NEXT31;C
JNB P3.4, $
MOV R5,#'3'
ACALL TULIS
JMP SCAN
NEXT31: JB P3.5, NEXT32;D
JNB P3.5, $
MOV R5,#'7'
ACALL TULIS
JMP SCAN
NEXT32: JB P3.6, NEXT33;E
JNB P3.6, $
MOV R5,#'B'
ACALL TULIS
JMP SCAN
NEXT33: JB P3.7, SCAN2;F
JNB P3.7, $
MOV R5, #01H
ACALL COMMAND
MOV R5,#'='
ACALL TULIS
SCAN2: JMP SCAN
;DJNZ R5, TEST
;TEST: LJMP LOOP
HERE: SJMP HERE
MOV DPTR,#0150H
;MOV R1,#0
NEXT_CHAR: MOV A,#0
MOVC A,@A+DPTR
JZ STRING_END
;ACALL DELAY
MOV R5,A
ACALL TULIS
;MOV R4,A
;ACALL HURUF
INC DPTR
AJMP NEXT_CHAR
STRING_END: SJMP $
CLOCK: SETB EN
ACALL DELAY_INIT
CLR EN
ACALL DELAY_INIT
NOP
RET
TULIS: MOV A,R5
;ORL A,#30H
;ANL A,#0F0H
MOV P1,A
SETB RS
CLR RW
ACALL CLOCK
MOV A,R5
;ORL A,#30H
;ANL A,#0F0H
SWAP A
MOV P1,A
SETB RS
CLR RW
ACALL CLOCK
RET
;HURUF: MOV A,R4
;ORL A,#30H
;ANL A,#0F0H
;MOV P1,A
;SETB RS
;CLR RW
;ACALL CLOCK
;MOV A,R4
;ORL A,#30H
;ANL A,#0F0H
;SWAP A
;MOV P1,A
;SETB RS
;CLR RW
;ACALL CLOCK
;RET
COMMAND: MOV A,R5
ANL A,#0F0H
MOV P1,A
CLR RS
CLR RW
ACALL CLOCK
MOV A,R5
SWAP A
MOV P1,A
CLR RS
CLR RW
ACALL CLOCK
RET
DELAY: MOV R7,#0FFH
DEL: NOP
NOP
DJNZ R7,DEL
RET
DELAY_INIT: MOV R7,#0FFH
DEL1: NOP
NOP
NOP
NOP
NOP
NOP
NOP
DJNZ R7,DEL1
STOP: RET
ORG 0150H
TABLE: DB '0',0
END
if u have any dot in program then chech the page number 302, for lcd and 313 for key pad for 4x4 of book "the 8051 micro controller & embedded system using c" writer is muhammand ali mazidi code is in assemble language if u have still problem then i send u working code hex file .
ok i send u hex file send email id
if u have any dot in program then chech the page number 302, for lcd and 313 for key pad for 4x4 of book "the 8051 micro controller & embedded system using c" writer is muhammand ali mazidi code is in assemble language if u have still problem then i send u working code hex file .
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?