FPGA Learning notes--light LED

Source: Internet
Author: User
Tags configuration settings

Software platform: Win7 (64bit) + Quartus II 9.1 (64-bit)

Hardware platform: Dong Li electronic easy-fpga Cyclone II ep2c5t114c8n

This board has been bought for a long time, after the purchase has been placed there, the following a lighting example.

1.Experimental tasks

Light Emitting diodes. Through this experiment, familiar with and master the CPLD/FPGA development software Quartus II methods of use and development process and Verilog HDL programming methods.

2.Experimental environment

Software experimental environment for Quartus II 9.1 development software.

3.Principle of experiment

FPGA devices, like single-chip microcomputer, provide users with a number of flexible independent input/output I/O ports (units). Each I/O port of the FPGA can be configured as input, output, bidirectional, open collector, and tri-State gate. As an outlet, the FPGA's I/O port can absorb up to 24mA of current, can directly drive led devices such as LEDs. Figure 1. 1 is a 8 LED hardware schematic. The schematic shows that if the eight LEDs are highlighted, the function of the light emitting diode can be illuminated by outputting the corresponding low level "0" on the corresponding pin as long as the pin is properly assigned and locked.

Figure 1. 1 light-emitting diode LED hardware schematic diagram

4.Experimental procedures

(1) Implementation with continuous assignment assign (file name LED_TEST.V)

Module name Led_test
Defining the output port
Output 0x AA
Endmodule

(2) Using Process assignment statements (file name led_test_1.v)

Module name Led_test_1
Defining the output port
reg[7:0]led;
Always
Begin
Output 0xAA
End
Endmodule
5.Lab Step 1) Open Quartus II software and build the project

(1) Open the Quartus II 9.1 software via the shortcut on the desktop, enter the integrated development environment, software interface 1. As shown in 2.

Figure 1. 2 Quartus II Software interface

(2) In Figure 1.2, select FileNew Project Wizard to create a new project. The New Project Wizard Description dialog box 1.3 shows

Figure 1.3 New Project Wizard Description dialog box

(3) Click Next in Figure 1.3 To enter the dialog box shown in 1.4

Figure 1.4 New project path, name, Top level entity Specify dialog box

(4) Click Next in Figure 1.4 To enter the dialog box shown in 1.5

Figure 1.5 New Project Add File dialog box

(5) Click Next in Figure 1.5 to enter the dialog box shown in 1.6. Specify the target device in the dialog box, where we select the Cyclone II series of Ep2c5t144c8

Figure 1.6 New Project Device selection dialog box

(6) After specifying the device, click Next to enter the dialog box shown in 1.7. This experiment uses the integrated environment development, does not use the third party EDA tool, uses the default setting.

Figure 1.7 New Project EDA Tool Setup dialog box

(7) Click Next in Figure 1.7 To enter the dialog box shown in 1.8. From this dialog box, you can see the project configuration Information report. Click Finish to complete the creation of the new project.

Figure 1.8 New Project configuration Information Report dialog box

2) Create a text editing file

(1) in the Quartus II main interface, select filenew to open the New File dialog box 1.9 shown.

(2) Select Veriloghdl file Click OK to create an empty VERILOGHDL files, the program in the list of experimental program input into the file, and then in the Quartus II main interface Select fileSave as renamed to L ED_TEST.V and save.

(3) Select the button in Figure 1.10 toolbar to start compiling, if you find an error in the compilation, find and correct the error until the compilation is successful.

Figure 1.10 led.v File Compilation dialog box

3) Select the device model and other settings for the device and PIN

(1) Select device model

Each type of FPGA chip may have different pins, so you should select the appropriate target FPGA chip model before making the pin assignment. This step has been completed in the new project, where the goal is for beginners to understand that the device model can still be selected and modified after the Quartus II project is created. In the Quartus II software main interface, select AssignmentsDevice to open the dialog box shown in 1.11. Specify the desired target device model in the dialog box.

Figure 1.11 Device Selection dialog box

(2) Other settings for the device and PIN

Click the device and PIN options in Figure 1.11 to open the Device and PIN Options dialog box, select the Configuration tab in the dialog box, and set it as shown in Figure 1.12, which is a serial configuration device EPCS1 active configuration mode. In the Device and Pin Options dialog box, select the Unused Pins tab to set the unused pins as high impedance input as shown in Figure 1.13.

Figure 1.12 Configuration settings

Figure 1.13 Unused pin settings

4) Assigning FPGA pins

(1) under the Quartus II Software main Page, select AssignmentsPins or select the toolbar button to open the 1.14 dialog box.

(2) According to the Development Board pin correspondence, enter each pin name in the To field, select the appropriate pin in the location bar, the final distribution results in 1.14.

(3) Select File close to exit.

Figure 1.14 Assigning a pin dialog box

5) Compiling project

Under Quartus II Main page, select processingstart compilation or click the button on the toolbar to start compiling until the Full Compilation Report dialog box appears, click OK.

6) Waveform Simulation

As this experiment is relatively simple, waveform simulation will be explained in detail in the following experiment.

7) Download the design program to the target FPGA

(1) Under Quartus II Main Page, select toolspragrammer or click on the toolbar will appear as shown in window 1.15.

Figure 1.15 Configuration dialog box

(2) When everything is ready, click Start to configure the FPGA with the configuration file, the configuration progress is shown in the Progress box, the configuration progress bar is 100%, the configuration is successful, you can observe the experiment phenomenon.

6.Experimental phenomena

The first experiment finally finished, see the Experiment Board on the 8 LED lights interval lit, is not a unique sense of accomplishment! Just do it, everything is so simple! Let's do the following experiment! The future of the experiment will be more exciting!

Finish.

FPGA Learning notes--light LED

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.