2 lines 16 characters, 8 bits, port line selection EN - P3.2,RS - P3.1,RW - P3.3
$MOD51
EN EQU P3.2
RS EQU P3.1
RW EQU P3.3
ORG 0000H
MOV A,#38H
LCALL LCD_COMD
MOV A,#0EH
LCALL LCD_COMD
MOV A,#06H
LCALL LCD_COMD
MOV A,#01H
LCALL LCD_COMD
MOV A,#'E'
LCALL LCD_TEXT
MOV A,#'C'
LCALL LCD_TEXT
MOV A,#'E'
LCALL LCD_TEXT
LOOP:SJMP LOOP
LCD_COMD:CLR C
LCALL WRITE
RET
LCD_TEXT:SETB C
LCALL WRITE
RET
WRITE:SETB EN
CLR RW
MOV RS,C
MOV P1,A
CLR EN
LCALL DELAY
RET
DELAY: MOV R0,#56
LOOP2: MOV R1,#255
LOOP1: DJNZ R1,LOOP1
DJNZ R0,LOOP2
RET
END
No comments:
Post a Comment