單片機(jī)實(shí)驗(yàn)程序.doc

單片機(jī)實(shí)驗(yàn)程序.doc

ID:52198897

大?。?0.50 KB

頁(yè)數(shù):11頁(yè)

時(shí)間:2020-03-24

單片機(jī)實(shí)驗(yàn)程序.doc_第1頁(yè)
單片機(jī)實(shí)驗(yàn)程序.doc_第2頁(yè)
單片機(jī)實(shí)驗(yàn)程序.doc_第3頁(yè)
單片機(jī)實(shí)驗(yàn)程序.doc_第4頁(yè)
單片機(jī)實(shí)驗(yàn)程序.doc_第5頁(yè)
資源描述:

《單片機(jī)實(shí)驗(yàn)程序.doc》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)

1、鍵盤(pán)顯示控制程序:ORG0000HJMPMAINMAIN:MOVP0,#0FFHMOVP1,#0FFHKEYDOWN:MOVP1,#0F0HLCALLDELAYMOVA,P1CJNEA,#0F0H,KEYSCANJMPKEYDOWNKEYSCAN:MOVA,#00HMOVP1,#0F0HMOVA,P1CJNEA,#70H,N1MOVR4,#03HJMPNEXTN1:CJNEA,#0B0H,N2MOVR4,#02HJMPNEXTN2:CJNEA,#0D0H,N3MOVR4,#01HJMPNEXTN3:C

2、JNEA,#0E0H,NEXTMOVR4,#00HJMPNEXTNEXT:MOVP1,#00FHMOVA,P1CJNEA,#07H,N4MOVR3,#08HJMPNEXTN4:CJNEA,#0BH,N5MOVR3,#04HJMPNEXTN5:CJNEA,#0DH,DISPLAYMOVR3,#00HJMPDISPLAYDISPLAY:MOVA,R4ADDA,R3MOVDPTR,#LEDTABMOVCA,@A+DPTRMOVP0,ALCALLDELAYLCALLDELAYMOVP0,#0FFHLJMPKE

3、YDOWNLCALLDELAYDELAY:MOVR6,#25HDELAY1:MOVR1,#10LOOP:MOVR2,#250DJNZR2,$DJNZR1,LOOPRETD2:MOVR7,#500DJNZR7,$DJNZR6,D2RETLEDTAB:DB0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,88H,83HENDORG0000HLJMPMAINORG0100HMAIN:MOVSP,#78HMOV78H,#00HMOV79H,#00HMOV7AH,#00H

4、MOV7BH,#00HMOV7CH,#00HMOV7DH,#00HMOV7EH,#00HKEYI:ACALLKS1CJNEA,#0F0H,LK1ACALLDIRAJMPKEYILK1:ACALLDIRACALLDIRACALLKS1CJNEA,#0F0H,LK2ACALLDIRAJMPKEYILK2:ACALLKS1MOVR2,AORLA,#0FHMOVP3,AMOVA,P3ANLA,#0FHADDA,R2;鍵特征值CJNEA,#0EEH,JZHI1MOVA,#00HPUSH0E0HJZHI1:CJN

5、EA,#0DEH,JZHI2MOVA,#01HPUSH0E0HJZHI2:CJNEA,#0BEH,JZHI3MOVA,#02HPUSH0E0HJZHI3:CJNEA,#7EH,JZHI4MOVA,#03HPUSH0E0HJZHI4:CJNEA,#0EDH,JZHI5MOVA,#04HPUSH0E0HJZHI5:CJNEA,#0DDH,JZHI6MOVA,#05HPUSH0E0HJZHI6:CJNEA,#0BDH,JZHI7MOVA,#06HPUSH0E0HJZHI7:CJNEA,#07DH,JZHI8

6、MOVA,#07HPUSH0E0HJZHI8:CJNEA,#0EBH,JZHI9MOVA,#08HPUSH0E0HJZHI9:CJNEA,#0DBH,KEYIMOVA,#09HPUSH0E0HLJMPKEYIDIR:MOVDPTR,#DEGMOVR0,#79H;數(shù)碼管第一位MOVR3,#0FEH;線選LD1:CLRP2.7CLRP2.6MOVA,@R0MOVCA,@A+DPTRMOVP0,ASETBP2.6CLRP2.6MOVP0,R3SETBP2.7LCALLDELYINCR0MOVA,R3JNBA

7、CC.5,LD2RLAMOVR3,ASJMPLD1LD2:RETDEG:DB3FH,06H,5BH,4FH,66HDB6DH,7DH,07H,7FH,6FHDELY:MOVR7,#02HDL:MOVR6,#0FFHDL6:DJNZR6,DL6DJNZR7,DLRETKS1:MOVP3,#0F0HMOVA,P3ANLA,#0F0HRET;鍵是否按下END能實(shí)現(xiàn):org0000hljmpmainorg0200hmain:init:MOV60H,#10hMOV61H,#10hMOV62H,#10hMOV63

8、H,#10hwait:??acallkeyscan?????????????????????;有鍵按下,轉(zhuǎn)定按鍵位置掃描acalldispsjmp???????wait???????;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;?????????????????????p1.7p1.6p1.5p1.4?????????????????

當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動(dòng)畫(huà)的文件,查看預(yù)覽時(shí)可能會(huì)顯示錯(cuò)亂或異常,文件下載后無(wú)此問(wèn)題,請(qǐng)放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫(kù)負(fù)責(zé)整理代發(fā)布。如果您對(duì)本文檔版權(quán)有爭(zhēng)議請(qǐng)及時(shí)聯(lián)系客服。
3. 下載前請(qǐng)仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動(dòng)等原因無(wú)法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請(qǐng)聯(lián)系客服處理。