基於fl2440開發板的led實驗

來源:互聯網
上載者:User
文章目錄
  • 基本知識:
  • 實驗原理圖:
基本知識:記憶體訪問指令:

LDR : memory--->register 將記憶體的值,存放到寄存器中

STR: register ---->memory

實驗原理圖:

Register   Address         R/W  Description Reset Value
GPBCON 0x56000010 R/W  Configures the pins of port B 0x0
GPBDAT  0x56000014 R/W  The data register for port B Undef.
GPBUP    0x56000018 R/W  Pull-up disable register for port B 0x0
Reserved 0x5600001c

00 = Input     01 = Output

GPB5/6/8/10 作為輸出

    0001 0001 0001 0100 0000 0000

           1            1         1       4          0           0

   0x111400

GPB5/6/8/10 設定輸出為低電平

     1010 1001 1111

        a        9        f

0xa9f

 

原始碼如下:

 

;**************************************

; 點亮幾個LED燈,實驗

;

;*************************************
    AREA LED, CODE, READONLY
   
    ENTRY;入口
   
START         ;start是標號要頂格
   
    LDR R3,=0x56000010
    LDR R2,=0x111400; 將gpb5/6/8/10作為輸出
    STR R2,[R3]
   

    LDR R4,=0x56000014
    LDR R5,=0xa9f;將gpb5/6/8/10輸出設定為低電平
    STR R5,[R4]
   
    B START
   
    END

 

實驗成功:本例子學習了最基本的彙編結構,以及格式要求,環境配置,以及下載。

 

---------------------------------------------------------堅持不懈、追求卓越 ----------------------------------------------------------------------

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.