LCD & Atmel
Petr Novotny
peno
Středa Březen 17 11:54:53 CET 2004
Ahoj lidi.
Pred casem tu bezela diskuse o LCD a PICu.
Narazil jsem na stejny problem, ale s Atmelem.
Mam disp. LM161556 s radicem KS0066U, pred inicializaci sviti na dip.
vsechny tecky v prvnich 8 znacich. Po inicializaci zhasnou, ale kdyz se
pokusim zapsat
znak, tak se nic nedeje. Pokud se pokusim zapsat prikaz do reg. (napr.
posun kurzoru)
objevi se zase tech 8 znaku plnych tecek.
Mohl by mi nekdo prosim poradit co delam spatne - kod prikladam.
Diky Peno
Petr Novotny
peno@space.cz
E bit P3.3 ; display E
RW bit P3.4 ; display RW
RS bit P3.5 ; display RS
disp equ P1
; --------------------------------------------------------------------------
---
; Start init
; --------------------------------------------------------------------------
---
START:
call initdisp2 ; Init LCD
setb RS
nop
mov P1,#'B'
call clk
clr RS
jmp $
; --------------------------------------------------------------------------
---
; Init display 8bit bus
; --------------------------------------------------------------------------
---
INITDISP2: mov a,#100 ; wait 100 ms
call waitms
clr RS ; register
clr RW ; write
nop
mov disp,#00110000b
call clk
mov a,#50 ; wait 50 ms
call waitms
mov disp,#00110000b
call clk
mov a,#2 ; wait 2 ms
call waitms
mov disp,#00110000b
call clk
mov a,#2 ; wait 2 ms
call waitms
mov disp,#00111000b ; 1 function set 8 bit interface, 2 line
call clk
mov a,#5 ; wait 5 ms
call waitms
mov a,#00001000b ; 3 display off
call clk
mov a,#3 ; wait 3 ms
call waitms
mov a,#00000001b ; 4 display clear
call clk
mov a,#50 ; wait 50 ms
call waitms
mov a,#00000110b ; 5 mode set - increment
call clk
mov a,#6 ; wait 6 ms
call waitms
mov a,#00001100b ; display ON
call clk
mov a,#6 ; wait 6 ms
call waitms
ret
; --------------------------------------------------------------------------
---
; Clock E
; --------------------------------------------------------------------------
---
CLK: setb E
nop
clr E
ret
$INCLUDE (time.a51)
end
Další informace o konferenci Hw-list