深圳市迈晶电子有限公司
英文版
0755-29630718
您现在的位置:网站首页 > 新闻中心 > LH12864C带字库图形点阵液晶屏显示模块驱动程序

LH12864C带字库图形点阵液晶屏显示模块驱动程序

来源:深圳市迈晶电子有限公司         添加时间:2018-09-21
LH12864C是一种采用低功耗CMOS技术实现的点阵图形LCD模块,内含KS0108B控制器,CSA与KS0108B(1)连通!CSB与KS0108B(2)连通!CSA/CSB为01时选通KS0108B(1);为10时选通CSB与KS0108B(2),为其他值时!禁止选通!总线处于高阻状态!
LH12864C带字库图形点阵液晶屏显示模块驱动程序如下:
;*****************************************
;PROGRAM:LH12864C
;CONTROLLER:KS0108B
;LOWLEVELACTIVE
;DATE:2005.10.06
;*****************************************
DATEQU20H
COMEQU21H
DL1EQU22H
DL2EQU23H
DL3EQU24H
PNEQUPSW.5
EEQUP3.2
RRWEQUP3.1
DDIEQUP3.0
CS1EQUP3.3
CS2EQUP3.4
RESEQUP3.5
ORG0030H
START:
CLRRES
LCALLDELAY
SETBRES
LCALLDELAY
MOVCOM,#0C0H;SETTHEDISPLAYSTARTLINE=0
ACALLWRCOM1
ACALLWRCOM2
MOVCOM,#3FH;SETDISPLAYON
ACALLWRCOM1
ACALLWRCOM2
MAIN:MOVDPTR,#DISP1;WRITETHEDISPLAYCONTENTOFDISP1
MOVR2,#4H
loop3:CLRA
MOVCA,@A+DPTR
MOV30H,A
INCDPTR
CLRA
MOVCA,@A+DPTR
MOV31H,A
MOVR1,#00H;R1ISTHEXADDRESS
LOOP2:MOVA,R1
ANLA,#0BFH;SETTHEPAGE(X)ADDRESS
ORLA,#0B8H
MOVCOM,A
ACALLWRCOM1
ACALLWRCOM2
MOVCOM,#40H;SETYADDRESS=0
ACALLWRCOM1
ACALLWRCOM2
MOVR0,#20H;20H=32D,WRITEONEPAGE
LOOP1:MOVDAT,30H
ACALLWRDAT1
ACALLWRDAT2
MOVDAT,31H
ACALLWRDAT1
ACALLWRDAT2
DJNZR0,LOOP1
INCR1
CJNER1,#08H,LOOP2
INCDPTR
ACALLDELAY
ACALLDELAY
DJNZR2,LOOP3
DISP1:db0ffh,0ffh,0aah,0aah
db0ffh,00h,0aah,55h
;======================================
SETBPN;PN=1:POSITIVE,PN=0:NEGATIVE
POEM:MOVDPTR,#DISP2
MOVR2,#00H;XADDRESS
LOOP10:MOVR3,#00H;YADDRESS
LOOP6:MOVA,R2;SETTHEXADDRESSOFAWORDINIC1
ORLA,#0B8H
MOVCOM,A
ACALLWRCOM1
MOVA,R3;SETTHEYADDRESSOFAWORDINIC1
ORLA,#40H
MOVCOM,A
ACALLWRCOM1
MOVR0,#010H;WRITETHEFIRST(UPPER)HALFOFAWORD
LOOP4:CLRA
MOVCA,@A+DPTR
JBPN,NEXT1
CPLA
NEXT1:MOVDAT,A
ACALLWRDAT1
INCDPTR
DJNZR0,LOOP4
MOVA,R2;SETTHEXADDRESSOFAWORD(LOWPART)INIC1
INCA
ORLA,#0B8H
MOVCOM,A
ACALLWRCOM1
MOVA,R3;SETTHEYADDRESSOFAWORD(LOWPART)INIC1
ORLA,#40H
MOVCOM,A
ACALLWRCOM1
MOVR0,#010H;WRITETHESECOND(LOW)HALFOFAWORD
LOOP5:CLRA
MOVCA,@A+DPTR
JBPN,NEXT2
CPLA
NEXT2:MOVDAT,A
ACALLWRDAT1
INCDPTR
INCR3
DJNZR0,LOOP5
CJNER3,#40H,LOOP6
MOVR3,#00H;YADDRESS
LOOP7:MOVA,R2;SETTHEXADDRESSOFAWORDINIC2
ORLA,#0B8H
MOVCOM,A
ACALLWRCOM2
MOVA,R3;SETTHEYADDRESSOFAWORDINIC2
ORLA,#40H
MOVCOM,A
ACALLWRCOM2
MOVR0,#010H;WRITETHEFIRST(UPPER)HALFOFAWORD
LOOP8:CLRA
MOVCA,@A+DPTR
JBPN,NEXT3
CPLA
NEXT3:MOVDAT,A
ACALLWRDAT2
INCDPTR
DJNZR0,LOOP8
MOVA,R2;SETTHEXADDRESSOFAWORD(LOWPART)INIC2
INCA
ORLA,#0B8H
MOVCOM,A
ACALLWRCOM2
MOVA,R3;SETTHEYADDRESSOFAWORD(LOWPART)INIC2
ORLA,#40H
MOVCOM,A
ACALLWRCOM2
MOVR0,#010H;WRITETHESECOND(LOW)HALFOFAWORD
LOOP9:CLRA
MOVCA,@A+DPTR
JBPN,NEXT4
CPLA
NEXT4:MOVDAT,A
ACALLWRDAT2
INCDPTR
INCR3
DJNZR0,LOOP9
CJNER3,#40H,LOOP7
INCR2
INCR2
MOVA,R2
XRLA,#08H
JZNEXT5
AJMPLOOP10
NEXT5:ACALLDELAY
ACALLDELAY
ACALLDELAY
;CPLPN;POS.,NEG.ALTERMODE
;AJMPPOEM
ljmpMAIN
SJMP$
;***********SUBROUTINE*******************
;------------WRITEDATATOIC1-----------
WRDAT1:PUSHACC
SETBCS1;OPENIC1,CLOSEIC2
CLRCS2
;SETBrrw;READTHESTATUSWORD
;CLRDDI
WD1:MOVP1,#0FFH
;SETBE
;MOVA,P1
;CLRE
;JBACC.7,WD1;BUSY?
SETBDDI
CLRrrw
MOVP1,DAT
SETBE;FALLINGEDGEOFE
NOP
CLRE
POPACC
RET
;------------WRITECOMMANDTOIC1-----------
WRCOM1:PUSHACC
SETBCS1;OPENIC1,CLOSEIC2
CLRCS2
SETBrrw;READTHESTATUSWORD
CLRDDI
WC1:MOVP1,#0FFH
SETBE
MOVA,P1
CLRE
JBACC.7,WC1;BUSY?
CLRrrw
MOVP1,COM
SETBE;FALLINGEDGEOFE
NOP
CLRE
POPACC
RET
;---------------READDATAFROMIC1----------
RDDAT1:PUSHACC
SETBCS1;OPENIC1,CLOSEIC2
CLRCS2
SETBrrw;READTHESTATUSWORD
CLRDDI
RD1:MOVP0,#0FFH
SETBE
MOVA,P1
CLRE
JBACC.7,RD1;BUSY?
SETBDDI
MOVP1,#0FFH
SETBE
MOVDAT,P1
CLRE
POPACC
RET
;------------WRITEDATATOIC2-----------
WRDAT2:PUSHACC
SETBCS2;OPENIC2,CLOSEIC1
CLRCS1
SETBrrw;READTHESTATUSWORD
CLRDDI
WD2:MOVP1,#0FFH
SETBE
MOVA,P1
CLRE
JBACC.7,WD2;BUSY?
SETBDDI
CLRrrw
MOVP1,DAT
SETBE;FALLINGEDGEOFE
NOP
CLRE
POPACC
RET
;------------WRITECOMMANDTOIC1-----------
WRCOM2:PUSHACC
SETBCS2;OPENIC2,CLOSEIC1
CLRCS1
SETBrrw;READTHESTATUSWORD
CLRDDI
WC2:MOVP1,#0FFH
SETBE
MOVA,P1
CLRE
JBACC.7,WC2;BUSY?
CLRrrw
MOVP1,COM
SETBE;FALLINGEDGEOFE
NOP
CLRE
POPACC
RET
;---------------READDATAFROMIC1----------
RDDAT2:PUSHACC
SETBCS2;OPENIC2,CLOSEIC1
CLRCS1
SETBrrw;READTHESTATUSWORD
CLRDDI
RD2:MOVP1,#0FFH
SETBE
MOVA,P1
CLRE
JBACC.7,RD2;BUSY?
SETBDDI
MOVP1,#0FFH
SETBE
MOVDAT,P1
CLRE
POPACC
RET
;----------------DELAY----------------
DELAY:MOVDL3,#03H
DLY2:MOVDL1,#08AH
MOVDL2,#0FEH
DLY1:NOP
DJNZDL2,DLY1
DJNZDL1,DLY1
DJNZDL3,DLY2
RET
;*******************************************************
disp2:db010h,022h,064h,0ch,0c0h,044h,054h,054h
db054h,07fh,054h,054h,0d6h,044h,040h,00h
db04h,04h,0feh,01h,00h,00h,0ffh,015h
db015h,015h,055h,095h,07fh,01h,00h,00h
db00h,0fch,044h,044h,044h,0feh,04h,00h
db0feh,022h,022h,022h,022h,0ffh,02h,00h
db00h,0fh,04h,04h,04h,08fh,040h,030h
db0fh,02h,02h,042h,082h,07fh,00h,00h
db00h,0fch,084h,084h,084h,0feh,014h,010h
db090h,010h,010h,010h,0ffh,010h,010h,00h
db00h,03fh,010h,010h,010h,03fh,00h,00h
db00h,023h,040h,080h,07fh,00h,00h,00h
db04h,024h,024h,024h,024h,03fh,0e4h,024h
db024h,03fh,024h,024h,0f4h,026h,04h,00h
db00h,00h,00h,00h,00h,00h,0ffh,00h
db00h,04h,08h,010h,0fh,00h,00h,00h
db02h,02h,0f2h,012h,092h,012h,012h,0feh
db012h,092h,012h,012h,0fah,013h,02h,00h
db00h,00h,0ffh,00h,08h,011h,00h,07fh
db00h,08h,051h,080h,07fh,00h,00h,00h
db020h,030h,0ach,063h,030h,00h,080h,060h
db01eh,00h,07h,018h,060h,0c0h,040h,00h
db022h,067h,022h,012h,012h,081h,040h,031h
db0fh,01h,041h,081h,07fh,00h,00h,00h
db020h,030h,0ach,063h,030h,00h,080h,060h
db01eh,00h,07h,018h,060h,0c0h,040h,00h
db022h,067h,022h,012h,012h,081h,040h,031h
db0fh,01h,041h,081h,07fh,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,00h,020h,01ch,0ch,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,0feh,042h,0c2h,042h,07fh,012h,08h
db08ch,057h,024h,054h,08ch,084h,080h,00h
db040h,07eh,040h,03fh,022h,022h,01h,0ffh
db042h,042h,042h,042h,042h,0ffh,02h,00h
db00h,00h,00h,00h,00h,00h,00h,0ffh
db020h,020h,020h,030h,020h,00h,00h,00h
db040h,040h,040h,040h,040h,040h,040h,07fh
db040h,040h,040h,040h,040h,060h,040h,00h
db00h,010h,088h,0c4h,023h,040h,042h,042h
db042h,042h,042h,0c2h,043h,062h,040h,00h
db02h,01h,00h,0ffh,00h,00h,00h,00h
db00h,040h,080h,07fh,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,080h,07fh
db080h,00h,00h,00h,00h,00h,00h,00h
db00h,080h,040h,020h,010h,0ch,03h,00h
db03h,0ch,010h,020h,040h,0c0h,040h,00h
db088h,044h,023h,018h,023h,044h,0c8h,020h
db010h,0fh,0e8h,08h,028h,018h,00h,00h
db00h,07fh,021h,021h,021h,07fh,080h,040h
db030h,0ch,03h,01ch,060h,0c0h,040h,00h
db00h,0feh,044h,048h,050h,0ffh,050h,048h
db04h,0fch,044h,044h,0c2h,062h,040h,00h
db00h,07fh,024h,022h,021h,03fh,021h,0a2h
db040h,03fh,00h,00h,0ffh,00h,00h,00h
db020h,024h,0e4h,026h,034h,020h,0fch,026h
db025h,0fch,024h,024h,0feh,04h,00h,00h
db08h,0eh,09h,08h,08ch,058h,023h,019h
db07h,07dh,081h,0b1h,0adh,0b0h,0c0h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,030h,048h,048h,030h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db080h,040h,020h,0f8h,047h,048h,048h,07fh
db048h,048h,048h,07fh,0c8h,068h,040h,00h
db00h,00h,00h,0ffh,00h,00h,0ffh,049h
db049h,049h,049h,049h,0ffh,01h,00h,00h
db00h,0f8h,01h,02h,0e6h,020h,022h,022h
db022h,022h,0f2h,022h,02h,0ffh,02h,00h
db00h,0ffh,00h,00h,01fh,08h,08h,08h
db08h,08h,01fh,040h,080h,07fh,00h,00h
db010h,021h,066h,00h,082h,0f2h,012h,012h
db0feh,012h,0feh,012h,012h,0fbh,012h,00h
db04h,04h,0feh,01h,00h,0ffh,042h,049h
db048h,048h,048h,049h,041h,0ffh,00h,00h
db010h,0ch,024h,0a4h,0a4h,064h,0a5h,026h
db024h,024h,024h,0a4h,024h,014h,0ch,00h
db00h,049h,049h,024h,024h,052h,089h,07fh
db04h,0ah,011h,011h,020h,060h,020h,00h
db080h,040h,020h,0f8h,07h,04h,0e4h,024h
db024h,0f4h,024h,04h,0fch,06h,04h,00h
db00h,00h,00h,0ffh,00h,00h,0fh,04h
db04h,0fh,040h,080h,07fh,00h,00h,00h
db00h,00h,0e0h,01eh,010h,010h,0f0h,00h
db00h,0ffh,020h,040h,080h,080h,00h,00h
db082h,041h,020h,01bh,04h,01bh,020h,040h
db040h,05fh,040h,040h,040h,061h,020h,00h
db04h,04h,04h,084h,0e4h,03ch,027h,024h
db024h,024h,024h,0f4h,024h,06h,04h,00h
db04h,02h,01h,00h,0ffh,09h,09h,09h
db09h,049h,089h,07fh,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,00h,020h,01ch,0ch,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db040h,03ch,010h,010h,0ffh,010h,050h,020h
db0d8h,017h,010h,010h,0f0h,018h,010h,00h
db04h,04h,04h,02h,0ffh,081h,081h,040h
db023h,014h,08h,016h,061h,0c0h,040h,00h
db020h,020h,024h,0a4h,0ach,0b4h,0a5h,0a6h
db0a4h,0b4h,0ach,0e6h,0a4h,030h,020h,00h
db00h,080h,0a0h,0afh,0aah,0aah,0aah,0ffh
db0aah,0aah,0aah,0afh,0a0h,080h,00h,00h
db040h,042h,044h,0cch,00h,042h,036h,02ah
db022h,0feh,021h,029h,025h,080h,00h,00h
db00h,040h,020h,01fh,021h,041h,05dh,049h
db049h,04fh,049h,049h,05dh,061h,021h,00h
db010h,010h,010h,0ffh,090h,050h,00h,03fh
db048h,048h,048h,044h,046h,0c4h,070h,00h
db02h,042h,081h,07fh,00h,00h,00h,0ffh
db049h,049h,049h,049h,049h,0ffh,01h,00h
db08h,08h,088h,088h,048h,028h,018h,0ffh
db018h,028h,048h,048h,088h,08ch,088h,00h
db01h,01h,00h,0feh,042h,042h,042h,043h
db042h,042h,042h,0feh,00h,01h,00h,00h
db04h,04h,04h,0c4h,03fh,04h,04h,04h
db0e4h,04h,01fh,084h,0c4h,06h,04h,00h
db04h,02h,01h,0ffh,00h,020h,010h,08h
db03fh,042h,041h,040h,040h,040h,070h,00h
db010h,010h,0d0h,0ffh,090h,018h,010h,010h
db090h,010h,010h,0ffh,010h,018h,010h,00h
db04h,03h,00h,0ffh,00h,03h,00h,00h
db00h,043h,080h,07fh,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
db00h,030h,048h,048h,030h,00h,00h,00h
db00h,00h,00h,00h,00h,00h,00h,00h
end
LH12864C产品资料信息可以访问网址:http://www.lcdlh.com/danse/COB/12864/95.html

相关产品推荐:

>lcd12864产品选型

联系方式
电话:0755-29630718
传真:0755-29630718
邮箱:ca_jyz1234@126.com
联系人:揭先生
地址:深圳市宝安区福永白石厦东区福丰达工业区三栋四楼
联系电话:0755-29630718     公司传真:0755-29630718     企业邮箱:ca_jyz1234@126.com
公司地址:深圳市宝安区福永白石厦东区福丰达工业区3栋四楼     备案号:粤ICP备12084576号
Copyright © 2015-2025 深圳市迈晶电子有限公司版权所有