device 16f628 dim temp as byte dim p1,p2,p3,p4,p5,p6,p7,p8,p9,p10 as byte symbol a0=porta.2 symbol rst=porta.7 symbol cs1=porta.6 symbol wr_rw=porta.3 symbol rd_e=porta.4 cmcon=7 trisb=0 '---------------------------------------- '------------portok beállítása----------- '---------------------------------------- high rst delayms 2 low a0 high wr_rw high rd_e high cs1 '---------------------------------------- '---------főprogram---------------------- '---------------------------------------- kezd: gosub reset gosub lcd_inicializalas ..... ..... end '---------------------------------------- '--------szubrutinok--------------------- '---------------------------------------- reset: low rst delayms 10 high rst delayms 10 return '---------------------------------- lcd_inicializalas: gosub system_set gosub scroll gosub hdot_scr gosub ovlay p1=$56 gosub display_off gosub clear_layer1 gosub clear_layer2 p1=$00 p2=$00 gosub csrw p1=$04 p2=$86 gosub csr_form gosub display_on return '---------------------------------- system_set: temp=$40 gosub wcmd temp=p1 gosub wdata temp=p2 gosub wdata temp=p3 gosub wdata temp=p4 gosub wdata temp=p5 gosub wdata temp=p6 gosub wdata temp=p7 gosub wdata temp=p8 gosub wdata return '---------------------------------- sleep_in: temp=$53 gosub wcmd return '---------------------------------- display_on: temp=$59 gosub wcmd return '---------------------------------- display_off: temp=$58 gosub wcmd temp=p1 gosub wdata return '---------------------------------- scroll: temp=$44 gosub wcmd temp=p1 gosub wdata temp=p2 gosub wdata temp=p3 gosub wdata temp=p4 gosub wdata temp=p5 gosub wdata temp=p6 gosub wdata temp=p7 gosub wdata temp=p8 gosub wdata temp=p9 gosub wdata temp=p10 gosub wdata return '---------------------------------- csrform: temp=$5D gosub wcmd temp=p1 gosub wdata temp=p2 gosub wdata return '---------------------------------- cgram_adr: temp=$5C gosub wcmd temp=p1 gosub wdata temp=p2 gosub wdata return '---------------------------------- csrdir: temp=%010011xx gosub wcmd return '---------------------------------- hdot_scr: temp=$5A gosub wcmd temp=p1 gosub wdata return '---------------------------------- ovlay: temp=$5B gosub wcmd temp=p1 gosub wdata return '---------------------------------- csrw: temp=$46 gosub wcmd temp=p1 gosub wdata temp=p2 gosub wdata return '---------------------------------- mwrite: temp=$42 gosub wcmd temp=p1 gosub wdata return '---------------------------------- wcmd: portb=temp high a0 low cs1 low wr_rw high wr_rw high cs1 return '---------------------------------- wdata: low a0 portb=temp low cs1 low wr_rw high wr_rw high cs1 high a0 return '----------------------------------