单片机电子秤设计软件程序清单.docx
《单片机电子秤设计软件程序清单.docx》由会员分享,可在线阅读,更多相关《单片机电子秤设计软件程序清单.docx(40页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、单片机电子秤设计软件程序清单程序清单;定义中文LCD液晶128X64的地址W_C_GLCDXDATA0E000HW_D_GLCDXDATA0E001HR_B_GLCDXDATA0E002HR_D_GLCDXDATA0E003H;-TIMER0DATA30H;延时时间的初值TIMER1DATA31H;调用延时子程序的次数DATA1DATA32H;点阵显示的变量1DATA2DATA33H;点阵显示的变量2XDATA34H;X方向的位置YDATA35H;Y方向的位置COUNTERDATA36H;计数器NDATA37H;行数变量D1DATA38H;点变量1D2DATA39H;点变量1ADDRDATA3
2、AH;起始的显示位置ADDR1DATA3BH;起始的显示位置临时变量N1DATA3CH;行数的临时变量;*;*主程序开场;*ORG0000HAJMPSTARTORG0030HSTART:CLRP1.0SETBP1.1MOVSP,#60HLCALLINITIAL_GLCD;调用LCD初始化LCALLKAIJI;显示开机画面LCALLDELAY500LCALLDELAY500LCALLDELAY500LCALLTISHI;显示主界面LCALLINI_8279;-;判定能否继续;-KEY_A:MOVDPTR,#8101H;8101H为8279命令MOVXA,DPTR;读状态字ANLA,#07H;判定
3、低三位能否为0CJNEA,#00H,LP1;不为0有键按下则跳转SJMPKEY_A;为0没键按下则继续查询LP1:MOVDPTR,#8100H;8100H为8279数据口MOVXA,DPTR;读键值CJNEA,#0DBH,KEY_A;判定能否按D键AJMPK1K1:LCALLYUZHI;阈值设定LCALLcelianjieguo;结果显示界面LCALLCELIANGJIEGUO;结果显示AJMP$;*;*主程序开场;*;=;各界面显示内容;=DHbr1:DB欢迎使用DHbr2:DB半桥电子秤DHbr3:DB设计人:xxxDHbr4:DB时间:xxxxDHbr5:DB*DHbr6:DB设置报警上
4、限DHbr7:DB确定DHbr8:DB请按D键DHbr9:DBDHbr10:DB报警上限重量:DHbr11:DB.gDHbr12:DB确定(E)CELIANG1:DB电子秤CELIANG2:DB重量是:CELIANG3:DB.gCELIANG4:DB返回(F);=;开机界面子程序;=KAIJI:MOVADDR1,#00H;第一行显示MOVN1,#08H;数量8个MOVDPTR,#DHbr1;需要显示的汉字位置CALLDHZ;调用汉字子序MOVADDR1,#10H;第二行显示MOVN1,#08HMOVDPTR,#DHbr2CALLDHZMOVADDR1,#08H;第三行显示MOVN1,#08HM
5、OVDPTR,#DHbr3CALLDHZMOVADDR1,#18H;第四行显示MOVN1,#08HMOVDPTR,#DHbr4CALLDHZRET;=;提示界面子程序;=TISHI:LCALLCLEAR_GLCD;去除LCD显示屏幕MOVADDR1,#00HMOVN1,#08HMOVDPTR,#DHbr5CALLDHZMOVADDR1,#10HMOVN1,#08HMOVDPTR,#DHbr6CALLDHZMOVADDR1,#08HMOVN1,#08HMOVDPTR,#DHbr7CALLDHZMOVADDR1,#18HMOVN1,#08HMOVDPTR,#DHbr8CALLDHZRET;=;阈值
6、设定界面子程序;=SHEDING:LCALLCLEAR_GLCDMOVADDR1,#00HMOVN1,#08HMOVDPTR,#DHbr9CALLDHZMOVADDR1,#10HMOVN1,#08HMOVDPTR,#DHbr10CALLDHZMOVADDR1,#08HMOVN1,#08HMOVDPTR,#DHbr11CALLDHZMOVADDR1,#18HMOVN1,#08HMOVDPTR,#DHbr12CALLDHZRET;=;测量界面子程序;=celianjieguo:LCALLCLEAR_GLCDMOVADDR1,#00HMOVN1,#08HMOVDPTR,#CELIANG1CALLDH
7、ZMOVADDR1,#10HMOVN1,#08HMOVDPTR,#CELIANG2CALLDHZMOVADDR1,#08HMOVN1,#08MOVDPTR,#CELIANG3CALLDHZMOVADDR1,#18HMOVN1,#08MOVDPTR,#CELIANG4CALLDHZRET;=;8279初始化子程序;=INI_8279:MOVDPTR,#8101HMOVA,#00HMOVXDPTR,AMOVA,#32HMOVXDPTR,AMOVA,#0DFHMOVXDPTR,ARET;=;键盘设定阈值子程序;=YUZHI:LCALLSHEDINGMOV44H,#00H;44H单元存按键次数,先清0
8、;*键盘按键存储空间*MOV55H,#00H;存入四次按键值MOV56H,#00HMOV57H,#00HMOV58H,#00HMOV50H,#00H;存阈值百位MOV51H,#00H;存阈值十位和个位MOV52H,#00H;存阈值小数位;*KEY_09:MOVDPTR,#8101H;判定能否有键按下MOVXA,DPTRANLA,#07HCJNEA,#00H,LPP1AJMPKEY_09;-;各个键的处理;-LPP1:MOVDPTR,#8100HMOVXA,DPTRB0:CJNEA,#0D8H,B1AJMPKK0B1:CJNEA,#0D0H,B2AJMPKK1B2:CJNEA,#0D1H,B3A
9、JMPKK2B3:CJNEA,#0D2H,B4AJMPKK3B4:CJNEA,#0C8H,B5AJMPKK4B5:CJNEA,#0C9H,B6AJMPKK5B6:CJNEA,#0CAH,B7AJMPKK6B7:CJNEA,#0C0H,B8AJMPKK7B8:CJNEA,#0C1H,B9AJMPKK8B9:CJNEA,#0C2H,BEAJMPKK9BE:CJNEA,#0DAH,YUZHIAJMPKKEKK0:MOV5BH,#00H;5BH存键值AJMPCOUNT_1KK1:MOV5BH,#01HAJMPCOUNT_1KK2:MOV5BH,#02HAJMPCOUNT_1KK3:MOV5BH,#03
10、HAJMPCOUNT_1KK4:MOV5BH,#04HAJMPCOUNT_1KK5:MOV5BH,#05HAJMPCOUNT_1KK6:MOV5BH,#06HAJMPCOUNT_1KK7:MOV5BH,#07HAJMPCOUNT_1KK8:MOV5BH,#08HAJMPCOUNT_1KK9:MOV5BH,#09HAJMPCOUNT_1KKE:AJMPEND_PCOUNT_1:MOVA,44H;44H存按键次数INCAMOV44H,ACJNEA,#05H,CW1;按键次数能否到达4次AJMPYUZHI;五次按键则重设阈值CW1:ADDA,#54H;键盘按键存储空间MOVR0,ACW2:CLRAM
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 单片机 电子秤 设计 软件 程序 清单
限制150内