Need help for use LCD with microcontroller

Started by belajardelphi September 21, 2003
orry for may bad english,

I need help to use Seiko LCD L1682( but we don't use pin 15th and
16th) with microcontroller 89c51
I attach the picture in files.
If some one can help me to give the flowchart how the LCD work with
microcontroller i am realy appreciated
( and the assembly program, if not too much to ask, but I really
aprreciated if some one could give me a hint)
With the flowchart I want to know when I must
give 'delay', 'iniziation', 'send instruction', 'send data'.
There is some flowchart in the instruction but i still don't get
it....
this is the instruction
If you want to know the data sheet for L1682 and 89c51 you can find
it here
http://www.seiko-usa-ecd.com/lcd/products/char_mods/l168200j000.html
http://www.atmel.com/dyn/products/product_card.asp?
family_id`4&family_name51+Architecture&part_id30 This is some assembly program that i try ,if tried any program and i
failed( i don't now if this work,when i send this email i have not
try it yet...i just get frustated ) and
i want your opinion

I use 8-bit data transfer.
;LCDProgram
org 00h
ljmp mulai
write_inst:
clear P2.1
clear P3.2
setb P3.2
clr P3.2
acall delay
ret

write_data:
mov P2,#80h
mov P0,R1
setb P3.2
clr P3.2
acall delay
ret
delay:
mov R0,#0
delay1:
mov R5,#50h
djnz R5,$
djnz R0,delay1
ret
Ldelay:
mov R2,030h
Ld1:
acall delay
djnz R2,Ld1
ret

tulis:
mov R4,#5
mov DPTR,#baca
barisa:
mov R3,#8
mov R1,#80h
acall write_inst
tulis1:
clr A
movc A,@A+DPTR
mov R1,A
Inc DPTR
acall write data
djnz R3,tulis1
barisb:
mov R3,#8
mov R1,#0c0h
acall write_inst
tulis2:
clr A
movc A,@A+DPTR
mov R1,A
Inc DPTR
acall write data
djnz R3,tulis2
acall Ldelay
djnz R4,barisa
ret

mulai:
mov R1,#03fH
acall write inst
mov R1,#0DH
acall write inst
mov R1,#06H
acall write inst
mov R1,#01H
acall write inst
mov R1,#0CH
acall write inst
acall tulis
ljmp clear_lcd

tunggu:
mov R4,#2
mov DPTR,#baca1

barisa1:
mov R3,#8
mov R1,#80h
acall write_inst
tulis11:
clr A
movc A,@A+DPTR
mov R1,A
Inc DPTR
acall write data
djnz R3,tulis11

barisb1:
mov R3,#8
mov R1,#0c0h
acall write_inst
tulis21:
clr A
movc a,@A+DPTR
mov R1,A
Inc DPTR
acall write data
djnz R3,tulis21
acall Ldelay
djnz R4,barisa1
ret

clear_Lcd:
setb P3.2
clr P2.1
mov P0,#01h
clr P3.2
acall Ldelay
acall tunggu
ajmp mulai

baca:
DB 'Alby'
DB 'Bintoro'
DB 'Gatot'
DB 'Kapan'
DB 'wisudane'

baca1:
Db 'Tahun 2003'
Db 'tunggu saja'

end