企业档案
- 会员类型:免费会员
- 工商认证: 【未认证】
- 最后认证时间:
- 法人:
- 注册号:
- 企业类型:生产商
- 注册资金:人民币万
联系我们
联系人:刘天伦
技术文章
12864显示屏并口汇编程序
点击次数:138 发布时间:2020/10/23 11:51:10
;st7565
;changed by
;change:2005-7-28
;(12864 8-bit TRI-STATE PARALLEL I/O PORT)
RESETPIN BIT P3.4
CSB BIT P3.7
RSPIN BIT P3.5
WRPIN BIT P3.1
RDPIN BIT P3.0
FILLA EQU 20H
FILLB EQU 21H
TEMP EQU 28H
LAB EQU 29H
LINENUM EQU 2AH
PAGENUM EQU 2BH
ORG 00H
JMP START
ORG 0030H
START:
CLR RESETPIN
CALL LDELAY
SETB RESETPIN
CALL LDELAY
CALL RESET
LCALL DISP_DRAW2
LCALL DISP_DRAW3
LCALL DISP_DRAW4
LCALLDISP_DRAW5
STOP:AJMP START
DISP_DRAW2:
MOV FILLA,#55H
MOV FILLB,#55H
CALL FILL
RET
DISP_DRAW3:
MOV FILLA,#0FFH
MOV FILLB,#0H
CALL FILL
RET
DISP_DRAW4:
MOV FILLA,#55H
MOV FILLB,#0AAH
CALL FILL
RET
DISP_DRAW5:
MOV A,#040H;FIRST LINE
CALLOUTI
MOV R3,#08H
MOV DPTR,#TABLE
MOV PAGENUM,#0B0H
D_0:
MOV A,PAGENUM
CALL OUTI
MOV A,#10H
CALL OUTI
MOV A,#0
CALL OUTI;SET SEG=0
MOV R2,#128
D_1:
CLR A
MOVC A,@A+DPTR
CALL OUTD
INC DPTR
DJNZ R2,D_1
MOV A,#00H
CALL OUTI;SET SEG=0
inc PAGENUM
DJNZ R3,D_0
CALL DELAY
RET
FILL:
MOV A,#040H;FIRST LINE
CALLOUTI
MOV R3,#08H
MOV PAGENUM,#0B0H
S_0:
MOV A,PAGENUM
CALL OUTI
MOV A,#10H
CALL OUTI
MOV A,#0
CALL OUTI ;SET SEG =0
MOV A,#0AFH;DIAPLAY ON
CALL OUTI
MOV R2,#64
F_1:
MOV A,FILLA
CALL OUTD
MOV A,FILLB
CALL OUTD
DJNZ R2,F_1
INC PAGENUM
DJNZ R3,S_0
CALL DELAY
RET
RESET:
MOV A,#0E3H
CALL OUTI
MOV A,#0A2H
CALL OUTI;SET LCD BAIS= 1/7
MOV A,#0A0H ;ADC=0 S1->S132
CALL OUTI
MOV A,#0C9H;SET SHK C1->C64
CALL OUTI
MOV A,#2CH
CALL OUTI;VC ON
CALL LDELAY
MOV A,#2EH
CALL OUTI;VR ON
CALL LDELAY
MOV A,#2FH
CALL OUTI;VF ON
CALL LDELAY
;MOV A,#0FBH
; CALL OUTI;booster set
; CALL LDELAY
MOV A,#0f8H
CALL OUTI
CALL LDELAY
MOV A,#00H
CALL OUTI;booster 5 times voltage
CALL LDELAY
MOV A,#81H;??????
CALLOUTI
CALL LDELAY
MOV A,#10H
CALLOUTI
CALL LDELAY
MOV A,#27H;??????
CALL OUTI
CALL LDELAY
MOV A,#0AFH;DIAPLAY ON
CALLOUTI
MOV A,#050H;FIRST LINE =COM1
CALLOUTI
CALL LDELAY
RET
OUTI: SETB RDPIN
nop
CLR RSPIN
NOP
CLR CSB
NOP
CLR WRPIN
NOP
MOV P1,A
NOP
SETB WRPIN
NOP
SETB CSB
NOP
SETB RSPIN
ret
OUTD: SETB RDPIN
NOP
SETB RSPIN
NOP
CLR CSB
NOP
CLR WRPIN
NOP
MOV P1,A
NOP
SETB WRPIN
NOP
SETB CSB
NOP
CLR RSPIN
ret
LDELAY:
MOV B,#5
L_1:
MOV R6,#5
DJNZ R6,$
DJNZ B,L_1
RET
DELAY:
MOV R7,#03FH ;delay about 130ms
DELAY1:MOV R6,#0FFH
DELAY2:
MOV R5,#0aH
DJNZ R5,$
DJNZ R6,DELAY2
DJNZ R7,DELAY1
RET
table:
;-- 调入了一幅图像:C:\Documents and Settings\Administrator\My Documents\My Pictures\12864C.bmp --
;-- 宽度x高度=128x64 --
end
原创作者:深圳市乾思迪电子科技有限公司