Try   HackMD

Project: Blinking LED on DE0-Nano (Intel FPGA)

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Tools You'll Need

  • FPGA Board: DE0-Nano (Cyclone IV EP4CE22F17C6N)
  • Software: Intel Quartus Prime Lite Edition
  • Language: Verilog
  • PC OS: Windows/Linux

Step-by-Step Guide

1. Create a New Quartus Project

2. Write Verilog Code
Create blinky.v:

verilog

module blinky (
    input wire clk,         // 50 MHz onboard clock
    output wire led         // Connect to one onboard LED
);

reg [24:0] counter = 0;

always @(posedge clk) begin
    counter <= counter + 1;
end

assign led = counter[24];   // Adjust bit to control blink rate

endmodule

3. Assign Pins to FPGA I/O
Use Pin Planner or create .qsf file entries manually:

For DE0-Nano:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Manual .qsf Example:

tcl

set_location_assignment PIN_R8 -to clk
set_location_assignment PIN_A15 -to led
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to clk
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to led

You can also use the GUI (Assignments > Pin Planner) to do this visually.

4. Compile the Project

  • Click Compile Design (takes ~1–2 minutes)
  • Fix any syntax or pin assignment issues

5. Program the FPGA

  • Connect the DE0-Nano via USB
  • Open Programmer (Tools > Programmer)
  • Detect USB-Blaster
  • Load .sof file and click Start

Your onboard LED should now blink!

Bonus: How It Works

  • The counter increments at 50 MHz
  • counter[24] toggles ~1.49 Hz = ~0.67s on/off → visible blinking

Change counter[23] or counter[25] to adjust speed.

Summary

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →