Nios II之LED实验(SDRAM+EPCS4配置)————基于Altera的DE0开发板

Nios II之LED实验(SDRAM+EPCS4配置)————基于DE0开发板
看了很多书,查了很多网上资料,看了黑金FPGA的视频,终于实现了LED的实验,感觉不错!特发此博文
基本的不做黑金视频教程的一样,这里不多说,不过我要说明一个问题,就是EPCS4的配置,网上说了(包括Altera公司的解释),其CycloneIII和CycloneII的EPCS配饰不一样的。CycloneII是会在quartusII软件里自动分配的,而CycloneIII是要自己手动配置的,具体的配置方法如下,(在我的Quartus II 8.1 Web Edition里成功!)
生成的kernel和cycloneII的有点不同,就是多了epcs的四个接口:

一开始还真是不知道该如何来分配器引脚,找了很久,终于找到:

In Cyclone® III devices, the EPCS controller does not automatically assign its output pins to the dedicated configuration pins on the FPGA. Instead, the output pins are exported to the top level design, giving users the flexibility to connect to any EPCS devices.

Therefore, in order to use the EPCS Configuration Controller the pins must be assigned manually, and the following settings must be made the Quartus® II software: 

    Choose Settings from the Assignments menu
    Click Device and Pin Options from the Device category
    Click Dual-Purpose Pins and then make the following changes:

Data[0] -> Use as regular I/O
Data[1] -> Use as regularr I/O
DCLK -> Use as regular I/O
FLASH_nCE/nCS0 -> Use as regular I/O

You must check the device Pin-Out file for the Cyclone III device which you are using to make the following pins assignments:

data0_to_the_epcs_controller -> DATA0
sdo_from the_epcs_controller -> DATA1,ASDO
dclk_from_epcs_controller -> DCLK
sce_from_the_epcs_controller -> FLASH_nCE 

 

这样在我的开发板的原理图里找到了这四个引脚,然后在kernel里重新命名:

然后在tcl脚本文件里的四个引脚如下(具体的用法参见NiosII那些事儿):

#data0_to_the_epcs_controller -> DATA0
#sdo_from the_epcs_controller -> DATA1,ASDO
#dclk_from_epcs_controller -> DCLK
#sce_from_the_epcs_controller -> FLASH_nCE 

#EPCS PINS#
set_location_assignment PIN_K1 -to DATA0
set_location_assignment PIN_K2 -to DCLK
set_location_assignment PIN_E2 -to SCE
set_location_assignment PIN_D1 -to SDO

然后还需要在quartusII软件里设置一些选项:

打开assignments->device->device and pin options,在一下两个选项开里修开,结果如下:

保存并编译,这样快接近成功了!

然后在NiosII-IDE8.1中的tools->quartusII programmer->在hardware setup里选择usb-blaster,add file添加.sof文件,start。。。,咦。。。没有翻反应啊。。。嘿嘿!在NiosII-IDE里右键工程文件->run as->hardware:

这样就在开发板上有流水灯的效果了!!

 

 

posted @ 2012-06-05 16:27  wdliming  阅读(3442)  评论(2编辑  收藏  举报