Lab 1: Introduction to FPGA Programming
Blinking LEDs on the DE10-Lite board

Blinking LEDs on the DE10-Lite board.

User-Defined LEDs

There are ten user-controllable LEDs connected to the FPGA on the board. Each LED is driven directly and individually by a pin on the MAX 10 FPGA. Driving its associated pin to a high logic level turns the LED on, and driving the pin low turns it off.

User-Defined LEDs

Pin Assignment of LEDs

Signal NameFPGA Pin No.DescriptionI/O Standard
LEDR0PIN_A8LED [0]3.3-V LVTTL
LEDR1PIN_A9LED [1]3.3-V LVTTL
LEDR2PIN_A10LED [2]3.3-V LVTTL
LEDR3PIN_B10LED [3]3.3-V LVTTL
LEDR4PIN_D13LED [4]3.3-V LVTTL
LEDR5PIN_C13LED [5]3.3-V LVTTL
LEDR6PIN_E14LED [6]3.3-V LVTTL
LEDR7PIN_D14LED [7]3.3-V LVTTL
LEDR8PIN_A11LED [8]3.3-V LVTTL
LEDR9PIN_B11LED [9]3.3-V LVTTL

Verilog HDL Code

module LED_Blinking (
    input clk,
    output reg [9:0] LED
);

reg [24:0] cnt; // Counter for timing LED blinking
reg [3:0] current_led = 0; // Current LED being blinked

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

    // Blink each LED for 5 seconds (assuming clock frequency of 50 MHz)
    if (cnt == 25000000) begin
        cnt <= 0;
        current_led <= current_led + 1; // Move to the next LED
        if (current_led == 10) begin
            current_led <= 0; // Reset to LED0 if all LEDs are blinked
        end
    end
end

// Assign the output of each LED based on the current_led signal
always @* begin
    LED = 10'b0000000000; // Initialize all LEDs to off
    LED[current_led] = cnt[24]; // Blink the current LED
end

endmodule

Pin Planner

Node NameDirectionLocationI/O BankVREF GroupFitter LocationI/O Standard
LED[9]OutputPIN_B117B7_N0PIN_B112.5 V
LED[8]OutputPIN_A117B7_N0PIN_A112.5 V
LED[7]OutputPIN_D147B7_N0PIN_D142.5 V
LED[6]OutputPIN_E147B7_N0PIN_E142.5 V
LED[5]OutputPIN_C137B7_N0PIN_C132.5 V
LED[4]OutputPIN_D137B7_N0PIN_D132.5 V
LED[3]OutputPIN_B107B7_N0PIN_B102.5 V
LED[2]OutputPIN_A107B7_N0PIN_A102.5 V
LED[1]OutputPIN_A97B7_N0PIN_A92.5 V
LED[0]OutputPIN_A87B7_N0PIN_A82.5 V
clkInputPIN_P113B3_N0PIN_P112.5 V

Output

References