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

<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) > 設(shè)計(jì)應(yīng)用 > 如何在20分鐘內(nèi)建立一個(gè)NIOS II開發(fā)環(huán)境

        如何在20分鐘內(nèi)建立一個(gè)NIOS II開發(fā)環(huán)境

        作者: 時(shí)間:2010-06-20 來源:網(wǎng)絡(luò) 收藏

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

        配置 FPGA
        從Tools 菜單選擇Programmer,選擇JTAG 模式和對(duì)應(yīng)的sof 文件,點(diǎn)擊Start,
        開始下載,如果成功,那么開始進(jìn)入軟件調(diào)試。

        啟動(dòng) IDE
        關(guān)閉 Programmer,打開頂層文件。快捷方法就是點(diǎn)圖標(biāo)

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

        選擇 Run Nios IDE,進(jìn)入IDE 。

        軟件工程文件
        選擇 File-》New -》Project 選項(xiàng)。

        選擇 C/C++ Application, 點(diǎn)擊Next。

        從模板中選擇 Hello LED,其他設(shè)置按默認(rèn)設(shè)置,點(diǎn)擊Finish。

        編譯工程文件
        選中 hello_led_0,按右鍵,選擇 Build Project
        ,
        結(jié)束后,右下方的控制臺(tái)會(huì)提示編譯結(jié)束。

        運(yùn)行程序
        從菜單中選擇 Run-》Run…,彈出對(duì)話框

        點(diǎn)擊 New,會(huì)自動(dòng)生成系統(tǒng)配置。

        點(diǎn)擊 Apply,然后點(diǎn)擊Run。
        開始下載程序到 SDRAM,并運(yùn)行起來。

        觀察板上的 4 個(gè)LED,大概沒隔4 秒,LED 會(huì)輪流閃爍一次。
        恭喜您,第 C 程序在 CPU 上已經(jīng)運(yùn)行起來了。
        如果感興趣,可以修改源文件,然后在編譯,運(yùn)行,看看 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個(gè)LED,所以當(dāng)led的Bit3和Bit0有效的時(shí)候,
        //就改變方向;
        {
        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/151795.htm

        上一頁 1 2 下一頁

        評(píng)論


        相關(guān)推薦

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

        關(guān)閉