在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 實(shí)驗(yàn)九 定時(shí)、記數(shù)、顯示(80C51單片機(jī)匯編語(yǔ)言編程)

            實(shí)驗(yàn)九 定時(shí)、記數(shù)、顯示(80C51單片機(jī)匯編語(yǔ)言編程)

            作者: 時(shí)間:2016-11-23 來(lái)源:網(wǎng)絡(luò) 收藏
            設(shè)計(jì)一個(gè)帶有控制功能的脈沖發(fā)生器/計(jì)數(shù)器系統(tǒng),脈沖發(fā)生器發(fā)出周期為2秒的方波(提示:可由P3.0口輸出,用發(fā)光二極管顯示);被計(jì)數(shù)脈沖由T0口輸入,所記錄的脈沖數(shù)以十進(jìn)制形式在數(shù)碼管顯示(至少應(yīng)可記錄256個(gè)脈沖);設(shè)兩個(gè)按鍵,一個(gè)啟動(dòng)脈沖發(fā)生器,一個(gè)啟動(dòng)記數(shù),(按一次啟動(dòng),再按一次停止),不啟動(dòng)時(shí),發(fā)光管滅,數(shù)碼管顯示學(xué)號(hào)。
            偉福:數(shù)碼管為共陰極;
            KEY/LED_CS與CS0連線,則段地址為:8004H,位地址為:8002H
            ORG 0000H
            AJMP MAIN
            ORG 0003H
            AJMP INT0
            ORG 0013H
            AJMP INT1
            ORG 001BH
            AJMP T1

            ORG 0030H
            MAIN:MOV TMOD,#16H ;T0計(jì)數(shù),T1計(jì)時(shí)
            MOV TH0,#00H
            MOV TL0,#00H
            MOV TH1,#0EFH
            MOV TL1,#0CH
            SETB EA
            SETB EX0
            SETB EX1
            SETB ET0
            SETB ET1
            SETB IT0
            SETB IT1
            CLR TR0
            SETB TR1
            ;SETB PX0
            CLR P3.1
            MOV R7,#100
            SJMP $

            ORG 0100H
            INT0:JB P3.1,AA ;脈沖開關(guān)
            MOV TH1,#0EFH
            MOV TL1,#0CH
            MOV R7,#100
            SETB P3.1 ;用3.1口作為判斷標(biāo)志
            ;SETB TR1
            RETI
            AA:CLR P3.1
            RETI

            ORG 0150H
            INT1:JB TR0,BB ;計(jì)數(shù)開關(guān)
            MOV TH0,#00H ;開始計(jì)數(shù)
            MOV TL0,#00H
            MOV TH1,#0EFH
            MOV TL1,#0CH
            SETB TR0
            RETI

            BB:CLR TR0 ;關(guān)閉計(jì)數(shù)器顯示學(xué)號(hào)
            MOV TH0,#00H
            MOV TL0,#00H

            T1:MOV TH1,#0EFH
            MOV TL1,#0CH

            JX:JNB TR0,XH1
            DY:ACALL H_BCD
            ACALL JISHU
            ACALL DISP

            DJNZ R7,GORET1
            MOV R7,#100
            JNB P3.1,DY
            CPL P3.0 ;用3.0作為脈沖發(fā)生器
            GORET1:RETI

            H_BCD:MOV A,TL0
            MOV B,#100
            DIV AB
            MOV 32H,A
            MOV A,#10
            XCH A,B
            DIV AB
            MOV 31H,A
            MOV 30H,B
            RET

            JISHU:MOV R2,#3 ;R2計(jì)數(shù),讓后三個(gè)數(shù)碼管都顯示
            MOV R0,#30H
            FT:MOV A,@R0 ;將所計(jì)數(shù)轉(zhuǎn)換成數(shù)碼管顯示形式
            MOV DPTR,#TAB
            MOVC A,@A+DPTR
            MOV @R0,A
            INC R0
            DJNZ R2,FT
            RET

            DISP:MOV DPTR,#8002H
            MOV A,#01H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,30H
            MOVX @DPTR,A
            ACALL DLAY
            MOV DPTR,#8002H
            MOV A,#02H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,31H
            MOVX @DPTR,A
            ACALL DLAY
            MOV DPTR,#8002H
            MOV A,#04H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,32H
            MOVX @DPTR,A
            ACALL DLAY
            RET

            XH1:MOV DPTR,#8002H
            MOV A,#01H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,#06H
            MOVX @DPTR,A
            ACALL DLAY

            XH2:MOV DPTR,#8002H
            MOV A,#02H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,#66H
            MOVX @DPTR,A
            ACALL DLAY

            XH3:MOV DPTR,#8002H
            MOV A,#04H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,#5BH
            MOVX @DPTR,A
            ACALL DLAY

            XH4:MOV DPTR,#8002H
            MOV A,#08H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,#5BH
            MOVX @DPTR,A
            ACALL DLAY

            XH5:MOV DPTR,#8002H
            MOV A,#10H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,#6FH
            MOVX @DPTR,A
            ACALL DLAY

            XH6:MOV DPTR,#8002H
            MOV A,#20H
            MOVX @DPTR,A
            MOV DPTR,#8004H
            MOV A,#3FH
            MOVX @DPTR,A
            ACALL DLAY

            DJNZ R7,GORET2
            MOV R7,#100
            JNB P3.1,XH1
            CPL P3.0 ;用3.0作為脈沖發(fā)生器
            GORET2:RETI

            RETI

            DLAY:MOV R6,#1000;延時(shí)子程序
            DJNZ R6,$
            RET

            TAB:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH


            評(píng)論


            技術(shù)專區(qū)

            關(guān)閉