;*******************************************************
; 图形点阵液晶显示器实验说明
;实验目的: 1.掌握使用图形点阵液晶显示字体和图形。
;实验内容: 1.显示一个图形
; 2.显示一段字,包括汉字和英文
;连线说明:
;液晶12864J: A1区-->A3区
; CS-->CS1(0F000H),片选
; RW-->A0,读/写控制端
; RS-->A1,数据/指令控制端
; CS1/2-->A2,左右半屏使能端
;*******************************************************
NAME MAIN ;演示主程序
EXTRN CODE(LCD_INIT,LCDClear,ByteDisL,ByteDisR,WordDisL,WordDisR,LineDisL,LineDisR)
MAIN_CODE SEGMENT CODE
STACK SEGMENT IDATA
RSEG STACK
DS 20H ;32 Bytes Stack
CSEG AT 0000H ;定位0
LJMP START
RSEG MAIN_CODE ;开始程序段
START: MOV SP,#STACK-1
MAIN: LCALL LCD_INIT ;液晶初始化
LCALL DelayTime ;延时
LCALL DisLine1 ;第2行显示"星研电子"
LCALL DelayTime
LCALL DisLine2 ;第3行显示"STAR ES51PRO"
LCALL DelayTime
LCALL DisLine3 ;第4行显示"欢迎使用"
LCALL DelayTime
SJMP MAIN
;第2行显示"星研电子"
DisLine1: MOV DPTR,#Line1_1
MOV A,#2 ;A-起始显示行地址,第2行
MOV B,#32 ;B-起始显示列地址,第32列,以下同
LCALL WordDISL ;左半屏,显示一个字子程序
MOV DPTR,#Line1_2
MOV A,#2
MOV B,#48
LCALL WordDISL
MOV DPTR,#Line1_3
MOV A,#2
MOV B,#0
LCALL WordDISR ;右半屏,显示一个字子程序
MOV DPTR,#Line1_4
MOV A,#2
MOV B,#16
LCALL WordDISR
RET
Line1_1:
;-- 文字: 星 --
DB 000H,000H,0FCH,082H,082H,0AAH,02AH,0AAH,0AAH,0AAH,02AH,002H,002H,0FCH,000H,000H
DB 000H,0EEH,09BH,090H,098H,094H,095H,080H,080H,080H,095H,095H,095H,095H,0FFH,000H
Line1_2:
;-- 文字: 研 --
DB 09EH,062H,002H,002H,002H,032H,0FEH,062H,002H,002H,032H,002H,002H,002H,062H,0DCH
DB 003H,03CH,040H,040H,046H,040H,0F1H,08EH,080H,040H,07CH,080H,080H,080H,0FEH,003H
Line1_3:
;-- 文字: 电 --
DB 000H,0F8H,004H,004H,044H,044H,006H,002H,002H,046H,044H,004H,004H,0F8H,000H,000H
DB 000H,00FH,010H,010H,011H,011H,0F0H,080H,090H,091H,091H,08CH,084H,087H,0C8H,078H
Line1_4:
;-- 文字: 子 --
DB 080H,040H,05EH,052H,052H,052H,032H,072H,082H,082H,042H,062H,052H,04CH,0C0H,000H
DB 007H,004H,004H,004H,0FCH,08CH,08CH,080H,080H,07CH,004H,004H,004H,004H,007H,000H
;第3行显示"STAR ES51PRO"
DisLine2: MOV DPTR,#Line2_1
MOV A,#4 ;A-起始显示行地址,第4行
MOV B,#16 ;B-起始显示列地址,第16列,以下同
LCALL ByteDISL ;左半屏,显示一个字节子程序
MOV DPTR,#Line2_2
MOV A,#4
MOV B,#24
LCALL ByteDISL
MOV DPTR,#Line2_3
MOV A,#4
MOV B,#32
LCALL ByteDISL
MOV DPTR,#Line2_4
MOV A,#4
MOV B,#40
LCALL ByteDISL
MOV DPTR,#Line2_5
MOV A,#4
MOV B,#48
LCALL ByteDISL
MOV DPTR,#Line2_6
MOV A,#4
MOV B,#56
LCALL ByteDISL
MOV DPTR,#Line2_7
MOV A,#4
MOV B,#0
LCALL ByteDISR ;右半屏字节显示数据
MOV DPTR,#Line2_8
MOV A,#4
MOV B,#8
LCALL ByteDISR
MOV DPTR,#Line2_9
MOV A,#4
MOV B,#16
LCALL ByteDISR
MOV DPTR,#Line2_10
MOV A,#4
MOV B,#24
LCALL ByteDISR
MOV DPTR,#Line2_11
MOV A,#4
MOV B,#32
LCALL ByteDISR
MOV DPTR,#Line2_12
MOV A,#4
MOV B,#40
LCALL ByteDISR
RET
;"STAR ES51PRO"
Line2_1:
DB 000H,070H,088H,008H,008H,008H,038H,000H,000H,038H,020H,021H,021H,022H,01CH,000H
Line2_2:
DB 018H,008H,008H,0F8H,008H,008H,018H,000H,000H,000H,020H,03FH,020H,000H,000H,000H
Line2_3:
DB 000H,000H,0C0H,038H,0E0H,000H,000H,000H,020H,03CH,023H,002H,002H,027H,038H,020H
Line2_4:
DB 008H,0F8H,088H,088H,088H,088H,070H,000H,020H,03FH,020H,000H,003H,00CH,030H,020H
Line2_5:
DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H
Line2_6:
DB 008H,0F8H,088H,088H,0E8H,008H,010H,000H,020H,03FH,020H,020H,023H,020H,018H,000H
Line2_7:
DB 000H,070H,088H,008H,008H,008H,038H,000H,000H,038H,020H,021H,021H,022H,01CH,000H
Line2_8:
DB 000H,0F8H,008H,088H,088H,008H,008H,000H,000H,019H,021H,020H,020H,011H,00EH,000H
Line2_9:
DB 000H,010H,010H,0F8H,000H,000H,000H,000H,000H,020H,020H,03FH,020H,020H,000H,000H
Line2_10:
DB 008H,0F8H,008H,008H,008H,008H,0F0H,000H,020H,03FH,021H,001H,001H,001H,000H,000H
Line2_11:
DB 008H,0F8H,088H,088H,088H,088H,070H,000H,020H,03FH,020H,000H,003H,00CH,030H,020H
Line2_12:
DB 0E0H,010H,008H,008H,008H,010H,0E0H,000H,00FH,010H,020H,020H,020H,010H,00FH,000H
;第4行显示"欢迎使用"
DisLine3: MOV DPTR,#Line3_1
MOV A,#6 ;A-起始显示行地址,第6行
MOV B,#32 ;B-起始显示列地址,第32列,以下同
LCALL WordDISL ;左半屏,显示一个字子程序
MOV DPTR,#Line3_2
MOV A,#6
MOV B,#48
LCALL WordDISL
MOV DPTR,#Line3_3
MOV A,#6
MOV B,#0
LCALL WordDISR ;右半屏,显示一个字子程序
MOV DPTR,#Line3_4
MOV A,#6
MOV B,#16
LCALL WordDISR
RET
Line3_1:
;-- 文字: 欢 --
DB 014H,024H,044H,084H,064H,01CH,020H,018H,00FH,0E8H,008H,008H,028H,018H,008H,000H
DB 020H,010H,04CH,043H,043H,02CH,020H,010H,00CH,003H,006H,018H,030H,060H,020H,000H
Line3_2:
;-- 文字: 迎 --
DB 040H,041H,0CEH,004H,000H,0FCH,004H,002H,002H,0FCH,004H,004H,004H,0FCH,000H,000H
DB 040H,020H,01FH,020H,040H,047H,042H,041H,040H,05FH,040H,042H,044H,043H,040H,000H
Line3_3:
;-- 文字: 使 --
DB 040H,020H,0F0H,01CH,007H,0F2H,094H,094H,094H,0FFH,094H,094H,094H,0F4H,004H,000H
DB 000H,000H,07FH,000H,040H,041H,022H,014H,00CH,013H,010H,030H,020H,061H,020H,000H
Line3_4:
;-- 文字: 用 --
DB 000H,000H,000H,0FEH,022H,022H,022H,022H,0FEH,022H,022H,022H,022H,0FEH,000H,000H
DB 080H,040H,030H,00FH,002H,002H,002H,002H,0FFH,002H,002H,042H,082H,07FH,000H,000H
;延时程序
DelayTime: PUSH 05H
PUSH 06H
PUSH 07H
MOV R5,#48
DelayTime_1: MOV R6,#100
DelayTime_2: MOV R7,#100
DJNZ R7,$
DJNZ R6,DelayTime_2
DJNZ R5,DelayTime_1
POP 07H
POP 06H
POP 05H
RET
END