[ bojan.g @ 31.08.2010. 14:47 ] @
Naime, imam zadatak da isprogramiram inerfejs za pomenuti lcd modul preko paralelnog porta u Emy8086, emulatoru za mikroprocesor 8086... Kada spojim lcd modul na napajanje, vidim da radi i sve ok...ali kad startujem kod na lcd modulu se nista ne mijenja, mislim da ni inicijalizacija ne prodje kako treba....ne znam gdje grijesim, jel moze neko da pomogne? Evo koda kojim pokusavam da ispisem na lcd slovo A: Code: #masm# ; Bios data area memory segment (0040:0000) BDA_segment equ 40h BDA_timer_counter equ 6Ch ; Timer/Counter variable ; This variable is updated 18.2 times in second ; by the system clock (8254 Counter0) ; Software delay macro (non-portable - depends on clock frequency) soft_delay macro cycles local petlja1, petlja2 mov bx, cycles petlja2: mov cx, 0FFFFh petlja1: nop nop loop petlja1 dec bx jnz petlja2 endm ; Hardware delay macro (portable) hard_delay macro ticks local again, check_timer mov cx, ticks mov ax, BDA_segment mov ds, ax again: mov ax, DS:BDA_timer_counter check_timer: cmp ax, DS:BDA_timer_counter jz check_timer loop again endm dseg segment 'data' Data equ 378h ;konstanta Data predstavlja adresu data porta Status equ 379h ;konstanta Status predstavlja adresu statusnog porta Control equ 37Ah ;konstanta Control predstavlja adresu kontrolnog porta poruka db 'A' dseg ends sseg segment 'stack' dw 128 dup(?) sseg ends cseg segment 'code' assume cs:cseg, ds:dseg, ss:sseg start: mov ax, dseg ;inicijalizacija segmentnih registara mov ds, ax mov ax, sseg mov ss, ax ;prvo INICIJALIZACIJA LCD DISPLEJA mov dx, Control mov al, 00000111b ;koristim kontrolne portove Co0=R/W,C1=RS,C2=E. mov dx, Data mov al, 38h soft_delay 3000 ;hard_delay 2 mov dx, Control mov al, 00000111b mov dx, Data mov al, 0Fh ;hard_delay 2 soft_delay 3000 mov dx, Control mov al, 00000111b mov dx, Data mov al, 06h ;hard_delay 2 soft_delay 3000 mov dx, Control mov al, 00000111b mov dx, Data mov al, 01h soft_delay 3000 ;hard_delay 2 mov dx, Control mov al, 00001101b ;hard_delay 2 soft_delay 3000 mov dx, Data mov al, 'A' ;pokusavam da ispisem slovo A na lcd out dx,al cseg ends end start |