penggunaan aplikasi topview simulator untuk pemograman LCD
Terlebih dahulu Anda Instal aplikasi simulasi
a. Select device : pilih 89C52
b. Operating frequency : 12 MHz atau = 12000000 Hz
c. Klik OK
File – Pilih External Module Setting – LCD
progamnya:
$mod51 org 0h
call init_LCD
start: mov R1,#80h ; Lokasi Display RAM, Row=1 Col=1 call write_inst
mov R1,#'S' call write_data mov R1,#'E'
........
........
call write_data stop: sjmp stop
Init_lcd:
mov r1,#00000001b ;Display clear call write_inst
mov r1,#00111000b ;Function set, Data 8 bit,2 line font 5x7 call write_inst
mov r1,#00001100b ;Display on, cursor off,cursor blink off call write_inst
mov r1,#00000110b ;Entry mode, Set increment call write_inst
ret
Write_inst:
clr P3.6 ; P3.6 = RS =0
mov P0,R1 ; P0 = D7 s/d D0 = R1 setb P3.7 ; P3.7 =EN = 1
call delay ; call delay time clr P3.7 ; P3.7 =EN = 0
ret
Write_data:
setb P3.6 ; P3.6 = RS =1
mov P0,R1 ; P0 = D7 s/d D0 = R1 setb P3.7 ; P3.7 =EN = 1
call delay ; call delay time clr p3.7 ; P3.7 =EN = 0
ret
delay: mov R0,#0 delay1:mov R7,#0fh
djnz R7,$
djnz R0,delay1 ret
end
semoga bermanfaat
0 Response to "penggunaan aplikasi topview simulator untuk pemograman LCD"
Post a Comment