Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/12/02 16:18
Read: times


 
#20727 - help lcd initialisation code

sir,
i am working on my project involving lcd display.(HD 44780 ) i went through tutorials listed on the site regarding this subject.
i have also followed everything given in the manufactures' app.notes( lampex).
But my program hasn't worked. please send me suggestions.






org 0000h
ajmp 0100h

org 0100h
mov b,#14h
again1: mov a,#0ffh; 15ms delay
again: nop
nop
dec a
jnz again
djnz b,again1

setb p3.0 ;enable
clr p3.1 ; write
clr p3.2; command register
mov a,#30h ;command word
mov p1,a
clr p3.0
mov b,#05h ;4.1 ms delay
again3: mov a,#0ffh
again2: nop
nop
dec a
jnz again2
djnz b,again3

setb p3.0
clr p3.1
clr p3.2
mov a,#30h; command word
mov p1,a
clr p3.0
mov a,#2fh ; 100microseconds delay
again4: nop
dec a
jnz again4
setb p3.0
clr p3.1
clr p3.2
mov a,#30h ; command word
mov p1,a
clr p3.0
mov a,#2fh ; 100microseconds delay
again5: nop
dec a
jnz again5

setb p3.0
clr p3.1
clr p3.2
mov a,#30h ; 8 data lines & 1 line & charactor font 5x7 dots
mov p1,a
clr p3.0
lcall wait_lcd

setb p3.0
clr p3.2
mov a,#08h ;
mov p1,a
clr p3.0
lcall wait_lcd

setb p3.0
clr p3.2
mov a,#01h
mov p1,a
clr p3.0

lcall wait_lcd

setb p3.0
clr p3.2
mov a,#06h
mov p1,a
clr p3.0
lcall wait_lcd

setb p3.0
clr p3.2
mov a,#0fh
mov p1,a
clr p3.0
lcall wait_lcd


dis: setb p3.0
setb p3.2
mov a ,#'7'
mov p1,a
clr p3.0
lcall wait_lcd
ajmp dis



wait_lcd:
mov a,#2fh ; 100microseconds delay
again7:
nop
dec a
jnz again7
ret
end


List of 7 messages in thread
TopicAuthorDate
help lcd initialisation code            01/01/70 00:00      
RE: help lcd initialisation code            01/01/70 00:00      
RE: help lcd initialisation code            01/01/70 00:00      
RE: help lcd initialisation code            01/01/70 00:00      
RE: help lcd initialisation code            01/01/70 00:00      
RE: help lcd initialisation code            01/01/70 00:00      
RE: help lcd initialisation code            01/01/70 00:00      

Back to Subject List