<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 單片機數(shù)字鐘設計

          單片機數(shù)字鐘設計

          作者: 時間:2013-04-02 來源:網(wǎng)絡 收藏

          WT: JB SECONDK,NK1

          LCALL DELY10MS

          JB SECONDK,NK1

          INC SECOND

          MOV A,SECOND

          CJNE A,#60,NS60

          MOV SECOND,#00H

          NS60: LCALL DISP

          JNB SECONDK,$

          NK1: JB MINITEK,NK2

          LCALL DELY10MS

          JB MINITEK,NK2

          INC MINITE

          MOV A,MINITE

          CJNE A,#60,NM60

          MOV MINITE,#00H

          NM60: LCALL DISP

          JNB MINITEK,$

          NK2: JB HOURK,NK3

          LCALL DELY10MS

          JB HOURK,NK3

          INC HOUR

          MOV A,HOUR

          CJNE A,#24,NH24

          MOV HOUR,#00H

          NH24: LCALL DISP

          JNB HOURK,$

          NK3: LJMP WT

          DELY10MS:

          MOV R6,#10

          D1: MOV R7,#248

          DJNZ R7,$

          DJNZ R6,D1

          RET

          DISP:

          MOV A,#DISPBUF

          ADD A,#8

          DEC A

          MOV R1,A

          MOV A,HOUR

          MOV B,#10

          DIV AB

          MOV @R1,A

          DEC R1

          MOV A,B

          MOV @R1,A

          DEC R1

          MOV A,#10

          MOV@R1,A

          DEC R1

          MOV A,MINITE

          MOV B,#10

          DIV AB

          MOV @R1,A

          DEC R1

          MOV A,B

          MOV @R1,A

          DEC R1

          MOV A,#10

          MOV@R1,A

          DEC R1

          MOV A,SECOND

          MOV B,#10

          DIV AB

          MOV @R1,A

          DEC R1

          MOV A,B

          MOV @R1,A

          DEC R1

          RET

          INT_T0:

          MOV TH0,#(65536-2000) / 256

          MOV TL0,#(65536-2000) MOD 256

          MOV A,#DISPBUF

          ADD A,DISPBIT

          MOV R0,A

          MOV A,@R0

          MOV DPTR,#TABLE

          MOVC A,@A+DPTR

          MOV P1,A

          MOV A,DISPBIT

          MOV DPTR,#TAB

          MOVC A,@A+DPTR

          MOV P3,A

          INC DISPBIT

          MOV A,DISPBIT

          CJNE A,#08H,KNA

          MOV DISPBIT,#00H

          KNA: INC T2SCNTA

          MOV A,T2SCNTA

          CJNE A,#100,DONE

          MOV T2SCNTA,#00H

          INC T2SCNTB

          MOV A,T2SCNTB

          CJNE A,#05H,DONE

          MOV T2SCNTB,#00H

          INC SECOND

          MOV A,SECOND

          CJNE A,#60,NEXT

          MOV SECOND,#00H

          INC MINITE

          MOV A,MINITE

          CJNE A,#60,NEXT

          MOV MINITE,#00H

          INC HOUR

          MOV A,HOUR

          CJNE A,#24,NEXT

          MOV HOUR,#00H

          NEXT: LCALL DISP

          DONE: RETI

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

          TAB: DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH

          END



          關(guān)鍵詞: 單片機 數(shù)字鐘 AT89S51

          評論


          相關(guān)推薦

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

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();