Haberler:

Forum kuralları güncellendi LÜTFEN  okuyunuz:  https://bit.ly/2IjR3ME

Ana Menü

3310 lcd kodları

Başlatan tatasoft, 25 Haziran 2005, 13:39:59

tatasoft

kodun son hali sorunsuz çalışıyor
;=======LCD_Nokia nse1,nse3,nsm1 / Version 1.0====================21/12/02==
;	cod LPH7366-1 / driver PCD8544
;	rb6,rb7     sclock,sdata
;	ra0,ra1,ra2,ra3	d/C,Reset,Vccmd,SCE
;     internal clock
;     standard crystal 4.000 MHz XT - 1us pe instructiune/pe aproape
;	Program realizat de Ing. Bergthaller Iulian-Alexandru 
;------------------------------------------------------------
;      cpu init

INCLUDE "Modedefs.Bas"     'needed for debug, not the PC-064PYL
DEFINE 	OSC		4			' Set Xtal Frequency
DEFINE SHIFT_PAUSEUS 1000    'slow down the shift clock
counter VAR WORD
lcd_chr	VAR	BYTE
digit var byte
i var byte
sclk VAR PORTB.6
sdta VAR PORTB.7
dorc VAR PORTA.0
rset VAR PORTA.1
enab VAR PORTA.3

init:
        Low PORTB   'port b to zero's
        Low PORTA   'port a to zero's
start:  Pause 100    '100ms pause
        high dorc   'select data register
        high enab   'chip off
        
        gosub lcres 'reset lcd routine
        lcd_chr=$21  'set extended instruction set
        gosub lccmd
        lcd_chr=$B5 'sets Vop
        gosub lccmd
        lcd_chr=$13 'Sets bias mux rate to 1:48
        gosub lccmd
        lcd_chr=$20 'Select basic instruction set
        gosub lccmd
        gosub cbild
        lcd_chr=$09 'all display segments on
        gosub lccmd
        pause 1500
        lcd_chr=$08 'display blank
        gosub lccmd
        pause 80
        lcd_chr=$0C 'normal mode
        gosub lccmd
        
top_left:        
        lcd_chr=$40 'sets y address to 0,0,0
        GoSub lccmd
        lcd_chr=$80 'sets X address to 0,0,0,0,0,0
        GoSub lccmd

disp_stuff: 
         'T
         for i=0 to 4
         digit =i
         lookup digit,[$01,$01,$7f,$01,$01],lcd_chr
         gosub lcdta
         next i
         'A
          for i=0 to 4
         digit =i
         lookup digit,[$7e,$11,$11,$11,$7e],lcd_chr
         gosub lcdta
         next i
          'T
         for i=0 to 4
         digit =i
         lookup digit,[$01,$01,$7f,$01,$01],lcd_chr
         gosub lcdta
         next i
          'A
          for i=0 to 4
         digit =i
         lookup digit,[$7e,$11,$11,$11,$7e],lcd_chr
         gosub lcdta
         next i
        
        GoTo son
lccmd:  Low dorc    'select common register
        Low enab
        GoSub dout
        High enab   'Turn off chip
        Return
dout:   Low sclk    'Clock low
        ShiftOut sdta,sclk,1,[lcd_chr\8] 'Serially shift out 8 bits of lcd_chr LSB first
        Return       
lcres:  Low rset    'reset lcd
        Pause 80
        High rset
        Return
cbild:  
        For counter=1 TO 504   'counter to clock in 8 bits by 84 columns by 6 pages =504bytes
        lcd_chr=$00
        GoSub lcdta
        Next counter  'go back to and decrement x until it is zero
       
        Return
lcdta:  High dorc   'select data register        
        Low enab    'chip on
        GoSub dout
        High enab 'chip off
        Return
son:
End
Acıların Çapraz Çavuşu ŞAFAK 22  

OG

@tatasoft

Örnek bir çalışmanız varmı?
FORUMU İLGİLENDİREN KONULARA ÖM İLE CEVAP VERİLMEZ.

i-rot

yazı çıkartmak için kodlarda ne değişkiliği yapmak gerekir?