MCS51汇编程序在240X128液晶屏显示一幅图象.docx
- 文档编号:12609109
- 上传时间:2023-04-20
- 格式:DOCX
- 页数:30
- 大小:22.89KB
MCS51汇编程序在240X128液晶屏显示一幅图象.docx
《MCS51汇编程序在240X128液晶屏显示一幅图象.docx》由会员分享,可在线阅读,更多相关《MCS51汇编程序在240X128液晶屏显示一幅图象.docx(30页珍藏版)》请在冰豆网上搜索。
MCS51汇编程序在240X128液晶屏显示一幅图象
T6963C驱动的汇编代码
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 240x128 graphic mode/Driver ic:
t6963C ;;
;; writed by hawk liu ;;
;; 2001 Aug. 22 ;;
;; 1/128 duty 1/12.3 bias ;;
;; Vop=20V ;;
;; STN GRAY Trasflective mode ;;
;; character/Graphic mode demo program ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;text cgrom address :
0000h---007fh
;text cgram address :
0080h---00ffh(text area:
001Eh)
;graphic ram address:
2000h---048fh(graphic area:
001Eh)
;offset register is used to determine the external charator ram area/not used/
CD EQU P3.7
WR EQU P3.6
RD EQU P3.5
CE EQU P3.4
REST EQU P3.3
ORG 00H
MAIN:
moV P1,#00H
CALL INITIAL
SC1:
;DISPLAY Elec&eltek map
CALL GRAPSET
MOV A,#00;38H ;l-address data;;;;;;;;;;;;;;;;;;
CALL WRTD;; pointer;;
MOV A,#20H;39H;h-address data;; address;;
CALL WRTD;; set:
0000H;;
MOV A,#24H;set pointer ;;;;;;;;;;;;;;;;;;
CALL WRTI
mov dptr,#MAP1
MOV R0,#128
SC11:
MOV R1,#30
CALL DISPLAYC
DJNZ R0,SC11
CALL DELAY
CALL SBLANK
MOV A,#00;38H ;l-address data;;;;;;;;;;;;;;;;;;
CALL WRTD;; pointer;;
MOV A,#20H;39H;h-address data;; address;;
CALL WRTD;; set:
0000H;;
MOV A,#24H;set pointer ;;;;;;;;;;;;;;;;;;
CALL WRTI
mov dptr,#MAP2
MOV R0,#128
SC21:
MOV R1,#30
CALL DISPLAYC
DJNZ R0,SC21
CALL DELAY
CALL SBLANK
CCHAR:
;CHARATER DISPLAY
CALL CHARSET
MOV A,#00;38H ;l-address data;;;;;;;;;;;;;;;;;;
CALL WRTD;; pointer;;
MOV A,#00H;39H;h-address data;; address;;
CALL WRTD;; set:
0000H;;
MOV A,#24H;set pointer ;;;;;;;;;;;;;;;;;;
CALL WRTI
MOV R0,#30
SCCHAR1:
mov dptr,#CGROM ;CGROM CHARATER DISPLAY(SHOW font table)
MOV R1,#128
CALL DISPLAYC
DJNZ R0,SCCHAR1
CALL DELAY
JMP MAIN
SBLANK:
MOV A,#00H ;l-address data;;;;;;;;;;;;;;;;;;
CALL WRTD;; pointer;;
MOV A,#20H;h-address data;; address;;
CALL WRTD;; set:
0000H;;
MOV A,#24H;set pointer ;;;;;;;;;;;;;;;;;;
CALL WRTI
MOV R0,#128
SCKK:
MOV R2,#6
SCBK:
mov dptr,#BLANK ;CGROM CHARATER DISPLAY(SHOW font table)
MOV R1,#5
CALL DISPLAYC
DJNZ R2,SCBK
DJNZ R0,SCKK
RET
INITIAL:
CLR REST
CALL DELAY0
SETB REST
RET
;====================================================set control word=====
CHARSET:
CALL CONTRWORD
MOV A,#80H;MODE SET initial cgrom
CALL WRTI
MOV A,#94H;DISPLAY MODE SET
CALL WRTI;Graphic off;CURSOR ON;BLINK OFF
RET
GRAPSET:
CALL CONTRWORD
MOV A,#80H;MODE SET initial cgrom
CALL WRTI
MOV A,#98H;DISPLAY MODE SET
CALL WRTI;Graphic oN
RET
CONTRWORD:
mov A,#00H;;;;;;;;;;;;;;;;;;
CALL WRTD;;;;
MOV A,#00H;data setting;;address:
0000h;;
CALL WRTD;;;;
MOV A,#40H;;1)text home ;;
CALL WRTI ;text home address ;;address:
0000h;;
MOV A,#30; TEXT Low4-bit ;;30columns/row;; CALL WRTD;;;;
call WRTD;;;;
MOV A,#00H ;TEXT AREA H4-bit;;;;
CALL WRTD;;;;
MOV A,#41H;command setting;;2)text area t;;
CALL WRTI;;ext area:
0010h;;
MOV A,#00H ;graphic L-4BIT ;;;;
CALL WRTD;;;;
MOV A,#20H;graphic h-4bit;;;;
CALL WRTD;;;;
MOV A,#42H ;;3)graphic HOME;;
CALL WRTI ;;ADDRESS:
2000h;;
MOV A,#30;graphic L-4BIT ;;30COLUME/row;;
CALL WRTD;;;;
MOV A,#00H;Graphic H-4bit ;;;;
CALL WRTD;;4)graphic area;;
MOV A,#43H ;;is :
0010h;;
CALL WRTI ;;;;;;;;;;;;;;;;;;
RET
WRTI:
CALL STA01
WRTII:
SETB CD
CLR WR
SETB RD
CLR CE
MOV P1,A
NOP
SETB CE
SETB WR
CLR CD
RET
WRTD:
;CALL DELAY0
CALL STA3
WRTDD:
CLR CD
SETB RD
CLR WR
CLR CE
MOV P1,A
NOP
SETB CE
SETB WR
SETB CD
RET
READS:
;CALL DELAY0
setb CD
CLR RD
setb WR
CLR CE
NOP
MOV A,P1
NOP
SETB CE
CLR WR
CLR CD
RET
displayC:
;CALL DELAY0
CALL AUTWR
DIS0:
CLR A
MOVC A,@A+dpTR
CALL WRTD
INC DPTR
DJNZ R1,DIS0
CALL AURSTW
RET
AUTWR:
;CALL DELAY0
CALL STA01
MOV A,#0B0H;SET DATA AUTO WRITE
CALL WRTII
RET
AURSTW:
;CALL DELAY0
CALL STA3;SET AUTORESET
MOV A,#0B2H
CALL WRTII
RET
STA01:
PUSH A;STATUS CHECK
clr a
CALL READS
ANL A,#03H
CJNE A,#03H,STA01GO
STA01GO:
POP A
RET
STA3:
PUSH A;AUTOWRITE CHECK
clr a
CALL READS
ANL A,#08H
CJNE A,#08H,STA3GO
STA3GO:
POP A
RET
;++++++++++++++++++++++++++++++++++++++++++;delay time
DELAY0:
MOV R0,#10 ;WAITING FOR 95 uS
DJNZ R0,$
RET
DELAY:
MOV 32H,#0FEH ;WAITING FOR 0.6 SECONDS
D2:
MOV 34H,#0FEH
D3:
MOV 36H,#14
DJNZ 36H,$
DJNZ 34H, D3
DJNZ 32H, D2
RET
BLANK:
DB 0,0,0,0,0
CGROM:
DB 00H,01H,02H,03H,04H,05H,06H,07H,08H,09H,00AH,00BH,00CH,00DH,00EH,00FH
DB 10H,11H,12H,13H,14H,15H,16H,17H,18H,19H,01AH,01BH,01CH,01DH,01EH,01FH
DB 20H,21H,22H,23H,24H,25H,26H,27H,28H,29H,02AH,02BH,02CH,02DH,02EH,02FH
DB 30H,31H,32H,33H,34H,35H,36H,37H,38H,39H,03AH,03BH,03CH,03DH,03EH,03FH
DB 40H,41H,42H,43H,44H,45H,46H,47H,48H,49H,04AH,04BH,04CH,04DH,04EH,04FH
DB 50H,51H,52H,53H,54H,55H,56H,57H,58H,59H,05AH,05BH,05CH,05DH,05EH,05FH
DB 60H,61H,62H,63H,64H,65H,66H,67H,68H,69H,06AH,06BH,06CH,06DH,06EH,06FH
DB 70H,71H,72H,73H,74H,75H,76H,77H,78H,79H,07AH,07BH,07CH,07DH,07EH,07FH
map1:
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,080H,000H
DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H
DB 000H,000H,000H,000H,00EH,000H,000H,000H,000H,000H,000H,001H,0BFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,000H,000H,000H,000H,000H,000H,000H,000H,000H
DB 000H,000H,01BH,0C0H,000H,000H,000H,000H,000H,001H,0BFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0FFH,0FFH,0BFH,0FFH,0BEH,000H,000H,000H,000H,000H,000H,000H,000H,000H,006H,0C1H
DB 0CFH,00FH,008H,000H,000H,000H,000H,001H,0BFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 0BFH,0C3H,0BEH,000H,000H,000H,000H,000H,000H,000H,000H,000H,007H,0E1H,09EH,00EH
DB 02CH,000H,000H,000H,000H,001H,0BFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,081H,0DAH
DB 002H,000H,000H,000H,000H,000H,000H,000H,000H,000H,00BH,0E1H,0FFH,0F8H,006H,000H
DB 000H,000H,000H,001H,0B0H,0FDH,0F9H,0C4H,07BH,0F0H,0F0H,0FFH,0BFH,0DBH,07EH,000H
DB 000H,000H,000H,000H,000H,000H,000H,000H,00FH,0F7H,0FFH,0FCH,00CH,000H,000H,000H
DB 000H,001H,0AFH,07DH,0F6H,0EEH,0E3H,0EFH,06FH,07FH,0BFH,0D7H,05EH,000H,000H,000H
DB 000H,000H,000H,060H,000H,000H,00FH,0FFH,0FFH,0C3H,038H,000H,000H,000H,000H,001H
DB 0AFH,079H,0EFH,075H,0FBH,0EFH,06FH,078H,003H,0D6H,0DEH,000H,000H,07FH,0C0H,000H
DB 000H,0FCH,000H,000H,01FH,0FFH,0FFH,081H,07FH,080H,000H,000H,000H,001H,0BFH,075H
DB 0EFH,075H,0FBH,0FFH,06FH,07BH,0FBH,0DAH,002H,000H,001H,0E0H,038H,00FH,0C1H,0BFH
DB 000H,000H,01FH,0FFH,0FEH,000H,0E2H,000H,000H,000H,000H,001H,0BEH,0EDH,0EFH,07BH
DB 0FBH,0FEH,0F0H,0FBH,0FBH,0DBH,0DEH,000H,003H,080H,00CH,05FH,0FCH,0FFH,000H,000H
DB 01FH,0FFH,0FEH,000H,0C8H,000H,000H,000H,000H,001H,0BDH,0EDH,0EFH,07BH,0FBH,0FDH
DB 0F6H,0FBH,0FBH,0DBH,0DEH,000H,00DH,0FFH,0F3H,0FFH,0FFH,0FFH,000H,000H,00FH,0FFH
DB 0FBH,082H,006H,000H,000H,000H,000H,001H,0BBH,0E0H,06FH,075H,0FBH,0FBH,0EFH,078H
DB 003H,0C8H,002H,000H,00DH,0FFH,0FBH,0FFH,0FDH,0FFH,080H,000H,007H,0FFH,0F3H,0C2H
DB 006H,000H,000H,000H,000H,001H,0B7H,0FDH,0EFH,075H,0FBH,0F7H,0EFH,07FH,0FFH,0D7H
DB 0DEH,000H,01FH,0FFH,0FFH,0FFH,0FFH,0FFH,000H,000H,003H,0FFH,0F0H,0CCH,007H,000H
DB 000H,000H,000H,001H,0AFH,07DH,0F6H,0EEH,0FBH,0EFH,06FH,076H,0DBH,0DFH,0DEH,000H
DB 033H,0FFH,0FFH,0FFH,0FFH,0FEH,000H,000H,00FH,0FFH,0F0H,078H,001H,080H,000H,000H
DB 000H,001H,0A0H,078H,079H,0C4H,060H,0E0H,070H,0F7H,06DH,0DFH,0DEH,000H,037H,0FFH
DB 0FFH,0FFH,0FFH,0FBH,000H,000H,03FH,0FFH,0C8H,040H,000H,07FH,080H,000H,000H,001H
DB 0BFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0EFH,06DH,0DFH,0DEH,000H,037H,0FFH,0FFH,0FFH
DB 0FFH,0D3H,000H,000H,02FH,0FFH,0F1H,0C0H,000H,000H,060H,000H,000H,001H,0BFH,0FFH
DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FEH,000H,033H,0FFH,0F3H,0FFH,0EFH,0FFH
DB 080H,000H,05FH,0FEH,07BH,080H,000H,000H,060H,000H,000H,001H,080H,000H,000H,000H
DB 000H,000H,000H,000H,000H,000H,000H,000H,033H,0FFH,0E7H,0FFH,0EFH,0FFH,080
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- MCS51 汇编程序 240 X128 液晶屏 显示 图象
![提示](https://static.bdocx.com/images/bang_tan.gif)