Krekter lcd leri programlamak kolay ama bu baya kafa şişiriyor. Hele assemler de program yazıyorsanız. Macro asseblerde include yi birtürlü beceremedim (becereniz) varsa banada söylesin bir zahmet bilmiyorum grafik displeylerle ugraşanınız varmı ben arama yaptım fakat bulamadım
Bu program lcd de bir kızın gerçek resmi çıkıyor
; ;*** Driver program for MG1206E4-SGL 128x64 graphics display ;*** Target: AT90S2313 at 4Mhz speed ;*** Author: Serasidis Vasilis ; ; ; ;
clr wreg rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$01 rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$02 rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$03 rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$04 rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$05 rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$06 rcall command rcall cs1 rcall next rcall cs2 rcall next
ldi wreg,$07 rcall command rcall cs1 rcall next rcall cs2 rcall next telos: rjmp telos
next: lpm ;Get next character from ROM mov temp,R0 cpi count,$40 ;See if at end of message breq cont ;If so, do next message rcall lcdwait ;Send it rcall write_lcd adiw ZL,1 ;Increment Z-pointer inc count rjmp next ;Loop for more
cont: clr count ret
;******************************************************************** cs1: Sbi PortD,2 ;Enable the CS1 of the display Cbi PortD,3 ;Disable the CS2 of the display ret
cs2: Cbi PortD,2 ;Enable the CS2 of the display Sbi PortD,3 ;Disable the CS1 of the display ret ;********************************************************************* ;*********************************************************************
Lcd_Init: Sbi PortD,2 ;Enable the CS1 of the display Sbi PortD,3 ;Enable the CS2 of the display cbi PortD,lcddi ;Clear D/I \_ cbi PortD,lcdrw ;Clear RW / Command mode
rcall Delay4ms ldi Wreg,$c0 ;Display start line = 0 (0-63) Out PortB,Wreg Rcall E_strobe
rcall Delay4ms ldi Wreg,$3f ;Display ON out PortB,Wreg rcall E_strobe Cbi PortD,2 ;Disable the CS1 of the display Cbi PortD,3 ;Disable the CS2 of the display ret
Sbi PortD,2 ;Enable the CS1 of the display Sbi PortD,3 ;Enable the CS2 of the display cbi PortD,lcddi ;Clear D/I Command mode ldi Wreg2,$b8 ;Set page (0-7) add wreg,wreg2 Out PortB,Wreg Rcall E_strobe sbi PortD,lcddi ;Set D/I Data mode
Ret
;********************************************************************* Delay40us: ldi r21,$40 Loop3: dec r21 brne loop3 ret ;********************************************************************* ;**** ;**** ;********************************************************************* Delay100us: ldi r21,$88 Loop: dec r21 brne loop ret ;********************************************************************* ;**** ;**** ;********************************************************************* Delay4ms: ldi r22,$1c Loop1: ldi r21,$00 Loop2: dec r21 brne loop2 dec r22 brne loop1 ret ;********************************************************************* ;**** ;**** ;********************************************************************* LongDelay: ldi wreg,255 ; Delay for about 1 sec for the LCD to start Longdelay_Loop: rcall delay4ms dec wreg brne LongDelay_Loop Ret