合泰單片機(jī)筆段式LCD顯示程序+電路圖
;內(nèi)容:5位LCD筆段式LCD顯示
;lcd接法SEG0-PD0...SEG7-PD7,SEG8-PE.0
;COM0-PC0,COM1-PC1,COM2-PC6,COM3-PC7
;完整源碼下載:http://www.51hei.com/f/htbdlcd.rar
include HT66F50.inc
ds.sectiondata
COM0EQUPC.0;COM0管腳定義
COM1EQUPC.1;COM0管腳定義
COM2EQUPC.6;COM0管腳定義
COM3EQUPC.7;COM0管腳定義
SEGEQUPD;SEG管腳定義
SEG9EQUPE.0;seg8管腳定義
SEG01EQU[90H];SEG0與seg1管腳數(shù)據(jù)寄存器
SEG23EQU[91H];SEG2與seg3管腳數(shù)據(jù)寄存器
SEG45EQU[92H];SEG4與seg5管腳數(shù)據(jù)寄存器
SEG67EQU[93H];SEG6與seg7管腳數(shù)據(jù)寄存器
SEG8EQU[94H];SEG8管腳數(shù)據(jù)寄存器
SEG_0EQU[95H];SEG管腳數(shù)據(jù)處理暫存寄存器
LCD1EQU[9AH];第1位LCD顯示數(shù)據(jù)寄存器
LCD2EQU[9BH];第2位LCD顯示數(shù)據(jù)寄存器
LCD3EQU[9CH];第3位LCD顯示數(shù)據(jù)寄存器
LCD4EQU[9DH];第4位LCD顯示數(shù)據(jù)寄存器
LCD5EQU[9EH];第5位LCD顯示數(shù)據(jù)寄存器
cs.sectioncode
ORG0000H
JMPA1
Q1:
DC06FH; 0
DC00AH; 1
DC073H; 2
DC03BH; 3
DC01EH; 4
DC03DH; 5
DC07DH; 6
DC00BH; 7
DC07FH; 8
DC03FH; 9
DC05FH; A
DC07CH; B
DC065H; C
DC07AH; D
DC075H; E
DC055H; F
A1:
MOVA,08H;
MOVCP0C,A;設(shè)置管腳不為比較器輸入口
MOVCP1C,A;
MOVA,7FH;
MOVSCOMC,A;設(shè)置PC.0.1.6.7為COM口并使能
CLRPCC;設(shè)置PC口為輸出口
CLRPDC;設(shè)置PD口為輸出口
CLRPEC.0;設(shè)置PE.0為輸出口
MOVA,1;
MOVLCD1,A;LCD1顯示數(shù)據(jù)
MOVA,2;
MOVLCD2,A;LCD2顯示數(shù)據(jù)
MOVA,3;
MOVLCD3,A;LCD3顯示數(shù)據(jù)
MOVA,4;
MOVLCD4,A;LCD4顯示數(shù)據(jù)
A2:
MOVA,LOWQ1;數(shù)據(jù)表地址低8位
MOVTBLP,A
MOVA,HIGHQ1;數(shù)據(jù)表地址高8位
MOVTBHP,A;
MOVA,LCD1;顯示數(shù)據(jù)地址碼
ADDMA,TBLP;查找數(shù)據(jù)表所在位置
TABRDSEG01;查表并存數(shù)據(jù)到SEG01
MOVA,LOWQ1;
MOVTBLP,A
MOVA,HIGHQ1;
MOVTBHP,A;
MOVA,LCD2;
ADDMA,TBLP;
TABRDSEG23;查表并存數(shù)據(jù)到SEG23
MOVA,LOWQ1;
MOVTBLP,A
MOVA,HIGHQ1;
MOVTBHP,A;
MOVA,LCD3;
評(píng)論