Nios Study notes 2--running lights experiment

Source: Internet
Author: User

Back to Quartus, we create a new Verilog file, paste the previously copied code in, save the file as LED.V. In order to compile later, the Nioscpu quartus IP File (. QIP) needs to be added to the project, click Assignments->settings, add Nioscpu.qip in File as shown, click Add, and then click OK.

Next, we create a PLL that provides the clock to the Nios.

Click Tools->megawizard Plug-in Manager, click Next, Search the PLL, select ALTPLL, add the PLL to the output file address on the right, and click Next:

Then page 1 is set as follows:

Device Speed Class 8, input clock set to 50M (because the Development Board crystal is 50M), click Next, on page 2 to remove the 2 hooks:

Then click Next until you set the CLK C0, as shown in the settings, set the C0 output frequency to 100M, which is the clock supplied to the Nios soft core, which corresponds to the 100M clock frequency we set in Nios previously.

Next we need to set the SDRAM clock frequency, click Next, as shown,

Check the Use this clock first, then set the Enter output clock parameters to 2 so that the actual frequency is 100MHz. Due to the signal delay of the circuit board and chip, we need to adjust the clock phase shift to achieve the coordination between the SDRAM clock and the soft core. We set the Clock phase shift to 73 (refer to Nios for specific reasons).

After setting up, click Finish, Appear quartusⅱip Files dialog box, click YES,PLL Build is complete. The PLL is then instantiated in the LED.V file and the entire project is complete, and as shown, someone might ask: Why use names like clock,led and reset? Let's sell a Xiaoguanzi and explain later.

Next, we assign the pins. Open the information along with the Development Board, locate the Ax301.tcl file, and copy it to the project directory. In Quartus, click Tools->tcl Scripts, as shown in:

Click Ax301.tcl, in preview we see that the E15 foot is set to Reset,e1 foot is set to clock, in the LED corresponding to the PIN also has 4 feet. You can check the circuit diagram to see if the corresponding is right. For example, as shown, the E1 pin corresponds to the clock, and the clock is exactly the same as the 50M crystal input, and the settings in the Tcl file are correct. We click Run in the TCL scripts, then click OK, then click Close. When we click Assignments–> pin Planner, we can see that pin assignment is OK.

Finally set up the project, click Assignments->device, click on the Device and Pin options in the page that appears, and in the Configuration tab, select Use configuration device, Select EPCS16 as shown in:

Then select as input tri-stated in the unused pins, which is mainly to prevent the buzzer from ringing, as shown in

All value is then set to the use as regular I/O in the dual-purpose pins, as shown in

then click OK. Compile at the end and exit when the compilation is complete.

Nios Study notes 2--running lights experiment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.