中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 在20分鐘內建立一個NIOS II開發(fā)環(huán)境的方法

        在20分鐘內建立一個NIOS II開發(fā)環(huán)境的方法

        作者: 時間:2012-03-17 來源:網(wǎng)絡 收藏

        經(jīng)過以上處理,就可以編譯和下載程序了。
        編譯項目
        從 Processing 菜單選Start compilation,或者Cntl+L,開始編譯。出現(xiàn)警告信息可以不管,等待編譯結束。

        配置 FPGA
        從Tools 菜單選擇Programmer,選擇JTAG 模式和對應的sof 文件,點擊Start,
        開始下載,如果成功,那么開始進入軟件調試。

        啟動 IDE
        關閉 Programmer,打開頂層文件。快捷就是點圖標

        雙擊 low_cost_1C20 系統(tǒng)模塊,進入SOPC Builder。

        選擇 Run Nios IDE,進入IDE

        軟件工程文件
        選擇 File-》New -》Project 選項。

        選擇 C/C++ Application, 點擊Next。

        從模板中選擇 Hello LED,其他設置按默認設置,點擊Finish。

        編譯工程文件
        選中 hello_led_0,按右鍵,選擇 Build Project

        結束后,右下方的控制臺會提示編譯結束。

        運行程序
        從菜單中選擇 Run-》Run…,彈出對話框

        點擊 New,會自動生成系統(tǒng)配置。

        點擊 Apply,然后點擊Run。
        開始下載程序到 SDRAM,并運行起來。

        觀察板上的 4 個LED,大概沒隔4 秒,LED 會輪流閃爍一次。
        恭喜您,第 C 程序在 CPU 上已經(jīng)運行起來了。
        如果感興趣,可以修改源文件,然后在編譯,運行,看看 LED 有什么變化
        以下是讓 LED 閃爍更頻繁的例子:
        int main (void) __attribute__ ((weak, alias (alt_main)));
        /*
        * Use alt_main as entry point for this free-standing application
        */
        int alt_main (void)
        {
        alt_u8 led = 0x2;
        alt_u8 dir = 0;
        volatile int i;
        /*
        * Infinitly shift a variable with one bit set back and forth, and write
        * it to the LED PIO. Software loop provides delay element.
        */
        while (1)
        {
        if (led 0x09) // 我們板上只有4個LED,所以當led的Bit3和Bit0有效的時候,
        //就改變方向;
        {
        dir = (dir ^ 0x1);
        }
        if (dir)
        {
        led = led >> 1;
        }
        else
        {
        led = led 1;
        }
        IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, led);
        /*
        * The delay element in this design has been written as a while loop
        * to avoid confusing the software debugger. A tight, one line software
        * delay loop such as:
        * for(i=0; i200000; i++);
        * can cause problems when it is stepped through using a software
        debugger.
        * The while loop below produces the same behavior as the for loop shown
        * above, but without causing potential debugger problems.
        */
        i = 0;
        while (i100000) //加快閃爍間隔
        i++;
        }
        return 0;
        }

        本文引用地址:http://www.antipu.com.cn/article/149395.htm
        上一頁 1 2 下一頁

        評論


        相關推薦

        技術專區(qū)

        關閉