EXP NO 4 MA PRACTICALS

ORG 0000H ;start
SJMP MAIN
ORG 0045H
MAIN:MOV A,#38H ;to declare type of LED-2 line LCD,5x7 matrix
ACALL CMD ;call command subroutine
ACALL DELAY ;call delay subroutine
MOV A,#01H ;clear the LCD screen
ACALL CMD
ACALL DELAY
MOV A,#0EH ;display on cursor blinking
ACALL CMD
ACALL DELAY
MOV A,#06H ;shift cursor to right by one position
ACALL CMD
ACALL DELAY
MOV A,#80H ;cursor on 1
st
line 1
st position

ACALL CMD
ACALL DELAY
MOV A,#'R' ;move characters to be displayed on LCD to accumulator one by one
ACALL INFO ;call data subroutine
ACALL DELAY
MOV A,#'O'
ACALL INFO
ACALL DELAY
MOV A,#'H'
ACALL INFO
ACALL DELAY
MOV A,#'I'
ACALL INFO
ACALL DELAY
MOV A,#'T'
ACALL INFO
ACALL DELAY

MOV A,#'_'
ACALL INFO
ACALL DELAY
MOV A,#'S'
ACALL INFO
ACALL DELAY
MOV A,#'H'
ACALL INFO
ACALL DELAY
MOV A,#'A'
ACALL INFO
ACALL DELAY
MOV A,#'R'
ACALL INFO
ACALL DELAY
MOV A,#'M'
ACALL INFO
ACALL DELAY
MOV A,#'A'
ACALL INFO
ACALL DELAY
CMD:MOV P0,A ;command subroutine
CLR P3.1 ;write operation
CLR P3.2 ;command register activated
SETB P3.3
CALL DELAY
CLR P3.3
RET
DELAY:MOV R2,#0FFH ; delay subroutine
UP:MOV R3,#0FFH
BACK:DJNZ R3,BACK
DJNZ R2,UP
RET
INFO:MOV P0,A ;data subroutine
CLR P3.1 ;write operation

SETB P3.2 ;data register activated
SETB P3.3
CALL DELAY
CLR P3.3
RET
END
Previous Post Next Post