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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 單片機(jī)驅(qū)動(dòng)8×8點(diǎn)陣LED

          單片機(jī)驅(qū)動(dòng)8×8點(diǎn)陣LED

          作者: 時(shí)間:2013-03-12 來源:網(wǎng)絡(luò) 收藏

          CLK EQU P3.2

          DINA EQU P3.3

          DINB EQU P3.4

          CLEAR EQU P3.5

          ORG 0000H

          AJMP MAIN

          ORG 0100H

          MAIN:

          MOV SP,#70H ;設(shè)堆棧指針

          MOV 50H,#07EH ;設(shè)置發(fā)送的列數(shù)據(jù)(Y0~Y7)

          MOV 51H,#0BDH

          MOV 52H,#0DBH

          MOV 53H,#0E7H

          MOV 54H,#0E7H

          MOV 55H,#0DBH

          MOV 56H,#0BDH

          MOV 57H,#07EH

          CLR CLEAR ;初始化I/O

          SETB CLK

          SETB DINA

          SETB DINB

          SETB CLEAR

          mainloop:

          mov r6,#8h;設(shè)置掃描次數(shù)

          mov dptr,#09000h;讀取掃描端口數(shù)據(jù)

          MOV R1,#50H ;指定列數(shù)據(jù)指針

          flashcy:

          MOV A,@R1 ;讀取列數(shù)據(jù)

          MOV R0,A

          INC R1 ;列數(shù)據(jù)指針加1

          CLR A

          MOVC A,@A+DPTR

          MOV P1,#0FFH

          LCALL SENDTO

          MOV P1,A

          INC DPTR

          LCALL DELAY

          DJNZ R6,flashcy

          SJMP MAINLOOP

          sendto: ;發(fā)送數(shù)據(jù)子程序

          PUSH ACC

          CLR CLK

          SENDTIME:

          MOV R7,#08H

          MOV A,R0

          CLR C

          SENDCY:

          RRC A

          MOV DINA,C

          SETB CLK

          CLR CLK

          DJNZ R7,SENDCY

          POP ACC

          RET

          DELAY: MOV R7,#01 ;延時(shí)子程序

          DELAY0: MOV R4,#17

          DELAY1: MOV R3,#28

          DJNZ R3,$

          DJNZ R4,DELAY1

          DJNZ R7,DELAY0

          RET

          ORG 09000H

          DB 0FEH,0FDH,0FBH,0F7H,0EFH,0DFH,0BFH,07FH ;X0~X7(列掃描)

          end


          上一頁 1 2 3 下一頁

          關(guān)鍵詞: 單片機(jī) 8×8 點(diǎn)陣LED

          評(píng)論


          相關(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); })();