51测试网 单片机教程XL2000开发板 单片机学习 自制编程器 单片机资料 软件下载 电子技术产品介绍如何购买 进入论坛

12832液晶屏驱动源程序

察看本站的产品全家福和网站介绍      本站产品正式流水线工艺生产情况          庆祝本站3年来首页点击量突破100万!

<>如果您在学习中遇到任何问题清参加51测试网(深圳学林电子有限公司)论坛讨论, 让更多的朋友帮助你!

<>12232驱动程序   <>12832驱动程序   <>12864驱动源程序   <>1602 驱动程序   <>0802 液晶驱动程序  <>回液晶主页

DI EQU P3.7
E EQU P3.5
RST EQU P3.2
cs1 equ p3.0
cs2 equ p3.1 

;本测试程序中CS1,CS2=H ,RW =>GND
ORG 0000H
LJMP MAIN

ORG 0003H
LJMP LINTO

ORG 0100H

MAIN: NOP
clr ea 
clr cs1
clr cs2
CLR E
lcall init 

MOV 34H,#0ffH
LCALL DISPLAY_ALL
lcall dly100

MOV 34H,#00H
LCALL DISPLAY_ALL

lcall plybw
lcall DLY100

MOV 34H,#00H
LCALL DISPLAY_ALL


MOV R1,#0C0H ;START =0 
LCALL WRI

mov 31h,#0
mov 30h,#0

MOV 30H,#0 ;x 
MOV 31H,#8 ;y 
MOV DPTR,#HZI7 ;您
LCALL outhz

MOV 30H,#0
MOV 31H,#40
MOV DPTR,#HZI8 ;好 
LCALL outhz

MOV 30H,#4
MOV 31H,#16
MOV DPTR,#HZI1 ;盛
LCALL outhz

MOV 30H,#4
MOV 31H,#32
MOV DPTR,#HZI2 ;宝
LCALL outhz

MOV 30H,#6
MOV 31H,#0
MOV DPTR,#HZI3 ;电
LCALL outhz

MOV 30H,#6
MOV 31H,#16
MOV DPTR,#HZI4 ;子
LCALL outhz 

MOV 30H,#6
MOV 31H,#32
MOV DPTR,#HZI5 ;公
LCALL outhz

MOV 30H,#6
MOV 31H,#48
MOV DPTR,#HZI6 ;司 
LCALL outhz

LCALL DLY100
LJMP MAIN 

LINTO: NOP
NOP
RETI

init: CLR RST ;RESET
LCALL DLY50
LCALL DLY50
LCALL DLY50
LCALL DLY50

setb rst
MOV R1,#3FH ;DISPLAY ON 
LCALL WRI

MOV R1,#0C0H ;START =0 
LCALL WRI

MOV 34H,#00H
LCALL DISPLAY_ALL
ret

DISPLAY_ALL: MOV R1,#0C0H ;START =0 
LCALL WRI

MOV R7,#8 ;DISPLAY DATA=34H
MOV R2,#0B8H 
LOP1: MOV A,R2
MOV R1,A ; X+1
LCALL WRI
MOV R1,#40H ; Y
LCALL WRI

MOV R5,#64
LOP11: MOV R1,34H
LCALL WRD 
DJNZ R5,LOP11

INC R2
DJNZ R7,LOP1

ret 


outhz: 
;30h=x (0-6) 31h=y(0-63-16)
MOV R1,#0C0H ;START =0 
LCALL WRI

MOV R7,#2
MOV A,#0B8H
ADD A,30H ;B8+X
MOV 30H,A ;A>>30H
HZ2: ; MOV A,R2
MOV R1,30H ; X+1
LCALL WRI

MOV A,#40H ; Y
ADD A,31H
; MOV 31H,A ;40+Y 
MOV R1,A
LCALL WRI

MOV R5,#16
HZ1: MOV A,#00H 
MOVC A,@A+DPTR 
MOV R1,A 
LCALL WRD
LCALL DLY10 
INC DPTR
DJNZ R5,HZ1

INC 30H
DJNZ R7,HZ2
RET

plybw: 
MOV R1,#0C0H ;START =0 
LCALL WRI

mov 30h,#0
mov 31h,#0
mov dptr,#bw
MOV R7,#8
MOV A,#0B8H
ADD A,30H ;B8+X
MOV 30H,A ;A>>30H
HZ2bw: ; MOV A,R2
MOV R1,30H ; X+1
LCALL WRI

; MOV A,#40H ; Y
;ADD A,31H
;MOV 31H,A ;40+Y 
;MOV R1,A
mov R1,#40h
LCALL WRI


MOV R5,#64
HZ1bw: MOV A,#00H 
MOVC A,@A+DPTR 
MOV R1,A 
LCALL WRD
LCALL DLY10 
INC DPTR
DJNZ R5,HZ1bw

INC 30H
DJNZ R7,HZ2bw
RET

WRI: ;写指令子程序 
CLR E
CLR DI
MOV P1,R1
lcall DLY10
SETB E
LCALL DLY10
CLR E
LCALL DLY10
LCALL DLY10
LCALL DLY10
RET

WRD: ;写数据子程序
CLR E
SETB DI
MOV P1,R1 
LCALL DLY10
SETB E
LCALL DLY10
CLR E
LCALL DLY10
LCALL DLY10
LCALL DLY10 
RET


DLY10:MOV R3,#01H
DL1:MOV R4,#01H
DL2:MOV R6,#0FH
DL3:DJNZ R6,DL3
DJNZ R4,DL2
DJNZ R3,DL1
RET

DLY50:MOV R3,#04H
DL111:MOV R4,#0FH
DL222:MOV R6,#0AFH
DL333:DJNZ R6,DL333
DJNZ R4,DL222
DJNZ R3,DL111
RET


DLY100:MOV R3,#06H
DL11:MOV R4,#0FFH
DL22:MOV R6,#0FFH
DL33:DJNZ R6,DL33
DJNZ R4,DL22
DJNZ R3,DL11
RET


ORG 0300H
WELCOM: DB 57H,65H,6CH,63H,6FH,6DH,65H,20H,20H,20H,20H,20H,20H,20H
DB 20H,20H,20H,20H,20H,20H
ORG 0320H
TINSHARP: DB 54H,49H,4EH,53H,48H,41H,52H,50H,20H,4CH,43H,4DH,20H,20H
DB 20H,20H,20H,20H,20H,20H

ORG 0340H 
HZI1: ;盛
DB 00H, 00H,0fcH, 24H, 24H, 24H,0e4H, 04H, 3fH,0c4H, 05H,0c6H, 34H, 04H, 00H, 00H
DB 44H, 43H, 40H, 78H, 49H, 4aH, 79H, 48H, 7aH, 4aH, 49H, 7aH, 44H, 64H, 47H, 00H
HZI2: ;宝
DB 10H, 0cH, 44H, 44H, 44H, 44H, 45H,0c6H, 44H, 44H, 44H, 64H, 44H, 14H, 0cH, 00H
DB 00H, 40H, 40H, 42H, 42H, 42H, 42H, 7fH, 42H, 4aH, 5bH, 42H, 60H, 40H, 00H, 00H
HZI3: ;电
DB 00H,0f8H, 48H, 48H, 48H, 48H,0ffH, 48H, 48H, 48H, 48H,0fcH, 08H, 00H, 00H, 00H
DB 00H, 07H, 02H, 02H, 02H, 02H, 3fH, 42H, 42H, 42H, 42H, 47H, 40H, 70H, 00H, 00H
HZI4: ;子
DB 80H, 80H, 82H, 82H, 82H, 82H, 82H,0e2H,0a2H, 92H, 8aH, 86H, 80H,0c0H, 80H, 00H
DB 00H, 00H, 00H, 00H, 00H, 40H, 80H, 7fH, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H
HZI5: ;公
DB 00H, 00H, 80H, 40H, 30H, 0cH, 00H,0c0H, 06H, 18H, 20H, 40H, 80H, 80H, 80H, 00H
DB 01H, 01H, 00H, 30H, 28H, 24H, 23H, 20H, 20H, 28H, 30H, 60H, 00H, 01H, 00H, 00H
HZI6: ;司
DB 10H, 10H, 92H, 92H, 92H, 92H, 92H, 92H,0d2H, 9aH, 12H, 02H,0ffH, 02H, 00H, 00H
DB 00H, 00H, 3fH, 10H, 10H, 10H, 10H, 10H, 3fH, 00H, 40H, 80H, 7fH, 00H, 00H, 00H
HZI7: ;您
DB 40H, 20H, 10H,0fcH, 23H, 10H, 8cH, 67H, 04H,0f4H, 04H, 44H, 94H, 8cH, 00H, 00H
DB 40H, 30H, 00H, 77H, 80H, 81H, 88H, 92H,0b4H, 83H, 80H,0e0H, 00H, 11H, 60H, 00H
HZI8: ;好
DB 10H, 10H,0f0H, 1fH, 10H,0f0H, 80H, 82H, 82H, 82H,0e2H, 92H, 8aH,0c6H, 80H, 00H
DB 40H, 22H, 15H, 08H, 14H, 63H, 00H, 00H, 40H, 80H, 7fH, 00H, 00H, 00H, 00H, 00H

bw: 
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H

DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH

DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H

DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH

DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H

DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH

DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H
DB 0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH, 00H, 00H, 00h, 00H, 00H, 00H, 00H, 00H

DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffh,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH
DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH,0ffH

END