<acronym id="xonnx"></acronym>
      <td id="xonnx"></td>
    1. <pre id="xonnx"></pre>

      1. 專注電子技術學習與研究
        當前位置:單片機教程網 >> MCU設計實例 >> 瀏覽文章

        三維LED立方體程序+視頻

        作者:huqin   來源:本站原創   點擊數:  更新時間:2014年04月08日   【字體:

           


               
                 ORG 0000H
                 AJMP MAIN
                 ORG 0031H
            MAIN:
                 MOV SP,#40H;          緩存首地址
                 MOV P0,#00H;          初始化行
                 MOV P1,#00H;          初始化塊
                 MOV P2,#00H;          初始化列
                
                 MOV A,#00H;           初始化暫存器
                 MOV R0,#00H;          初始化數據指針
            DAA: MOV A,R0;
                 MOV DPTR,#HTABLE
                 MOVC A,@A+DPTR;       對行數據緩存
                 MOV DPTR,#TABLE;      對行數據進行解碼
                 MOVC A,@A+DPTR;
                 MOV 20H,A;            解碼后的行數據進入行緩存器 
                
                 MOV A,R0
                 MOV DPTR,#LTABLE
                 MOVC A,@A+DPTR;        對列數據緩存
                 MOV DPTR,#TABLE
                 MOVC A,@A+DPTR;        解碼列數據
                 MOV 21H,A;             解碼后的列數據進入行緩存器 
                
                 MOV A,R0
                 MOV DPTR,#ZTABLE
                 MOVC A,@A+DPTR;         對塊數據緩存
                 MOV DPTR,#TABLE
                 MOVC A,@A+DPTR;        解碼塊數據
                 MOV 22H,A;            解碼后的列數據進入行緩存器 
                 ACALL AAA;            執 行行列塊掃描  
                 INC R0;               下一數據做準備
                 CJNE R0,#05H,DAA;     數據是否超值
                 MOV R0,#00H;          超值重新復位數據
                 SJMP DAA;             對下一數據進行操作
                
             * ******************************************************************************************************************************************************以下為行列塊定義·掃描·以及解碼,行列塊數據。*中得內容以及“*”將不出現在匯編編譯器。
          *********************************************************************************************************************************************************     
                
                
              H1 BIT 00H
              H2 BIT 01H
              H3 BIT 02H
              L1 BIT 08H
              L2 BIT 09H
              L3 BIT 0AH
              Z1 BIT 10H
              Z2 BIT 11H
              Z3 BIT 12H
         
         
        AAA:JB H1,AAB
            JB H2,AAC
            JB H3,AAD
        AAE:   RET
        AAB:MOV P0,20H;
            ACALL BAA
            SJMP AAE
        AAC:MOV P0,20H;
            ACALL BAA
            SJMP AAE
        AAD:MOV P0,20H;
            ACALL BAA
            SJMP AAE
        
        BAA:JB L1,BAB
            JB L2,BAC
            JB l3,BAD
        BAE:   RET
        BAB:MOV P2,21H;
            ACALL CAA
            SJMP BAE
        BAC:MOV P2,21H;
            ACALL CAA
            SJMP BAE
        BAD:MOV P2,21H;
            ACALL CAA
            SJMP BAE
         
        CAA:JB z1,CAB
            JB Z2,CAC
            JB Z3,CAD
                RET
        CAB:MOV P1,22H;
                RET
        CAC:MOV P1,22H;
                RET
        CAD:MOV P1,22H;
                RET
        TABLE:DB 00H, 01H,02H,04H,08H,10H,20H,40H,80H;     解碼翻譯
        HTABLE :DB 01H,02H,01H,01H,01H,03H------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(省略N個行特征碼);                          行特征碼
         
         
        LTABLE :DB 01H,01H,03H,02H,02H,01H   ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(省略N個列特征碼);                         
         
         
        ZTABLE :DB 01H,03H,02H,03H,03,02H   ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(省略N個塊特征碼);                                                      塊特征碼
        end
                 
        關閉窗口

        相關文章

        欧美性色欧美精品视频,99热这里只有精品mp4,日韩高清亚洲日韩精品一区二区,2020国自产拍精品高潮