This is my hobbies project not for the school
I learn....is this wrong!!!! Sorry, guys
Here I have piece of subroutine to shown character on LCD 2 x 16 line
But if combine with Switch Button and DIP Switch what I means,
my program can't shown text on LCD
Anyone can complete my piece routine according my circuit????
Thank you
**broken link removed**
;-----------------------------------------------------------------
org 0h
start: call init_LCD
mov R1,#80h
call write_inst
mov R1,#'H'
call write_data
mov R1,#'e'
call write_data
mov R1,#'l'
call write_data
mov R1,#'l'
call write_data
mov R1,#'o'
call write_data
mov R1,#' '
call write_data
mov R1,#'W'
call write_data
mov R1,#'o'
call write_data
mov R1,#'r'
call write_data
mov R1,#'l'
call write_data
mov R1,#'d'
call write_data
EndChar:
sjmp Endchar
Init_lcd:
mov r1,#00000001b ;Display clear
acall write_inst ;
mov r1,#00111000b ;Function set,
;Data 8 bit,2 line font 5x7
acall write_inst ;
mov r1,#00001100b ;Display on,
;cursor off,cursor blink off
acall write_inst
mov r1,#00000110b ;Entry mode, Set increment
acall write_inst
ret
;
Write_inst:
clr P2.0 ; RS = P2.0 = 0, write mode instruction
mov P0,R1 ; D7 s/d D0 = P0 = R1
setb P2.1 ; EN = 1 = P2.1
call delay; call delay time
clr P2.1 ; EN = 0 = P2.1
ret
;
Write_data:
setb P2.0 ; RS = P2.0 = 1, write mode data
mov P0,R1 ; D7 s/d D0 = P0 = R1
setb P2.1 ; EN = 1 = P2.1
call delay; call delay time
clr p2.1 ; EN = 0 = P2.1
ret
;
delay: mov R0,#0
delay1:mov R7,#0fh
djnz R7,$
djnz R0,delay1
ret
;
end