Interfacing LCD | 8051 Microcontroller Embedded Program Code ASM

 This is a simple program for LCD. Tried and Tested on TOPVIEW SIMULATOR. Run and View. Settings for LCD should be Correct else it will not run. If you don’t know the settings, Comment on this page to know.

$mod51
org 0
mov a, #38h
acall cmd
mov a, #0h
acall cmd
mov a, #0eh
acall cmd
mov a, #80h
acall cmd
mov a, #’I’
acall dat
mov a, #’N’
acall dat
mov a, #’D’
acall dat
mov a, #’I’
acall dat
mov a, #’A’
acall dat
mov a, #’s’
acall dat
mov a, #0c0h
acall cmd
mov a, #’B’
acall dat
mov a, #’E’
acall dat
mov a, #’S’
acall dat
mov a, #’T’
acall dat

sjmp $

cmd:

mov p3, a
clr p1.0
clr p1.1
setb  p1.2
acall delay
clr p1.2
ret

dat:

mov p3, a
setb p1.0
clr p1.1
setb p1.2
acall delay
clr p1.2
ret

delay:
mov r6,#25
k3: mov r1, #255
k2: mov r2, #255
k1: djnz r2, k1
djnz r1, k2
djnz r6, k3
ret
end

Add Comment