element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs First Activity: Blinking LED using Altera Cyclone IV FPGA DE0-Nano Board
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: tanishqe
  • Date Created: 10 Oct 2021 10:27 AM Date Created
  • Views 4719 views
  • Likes 0 likes
  • Comments 2 comments
  • blinking_led
  • verilog
  • hello fpga
Related
Recommended

First Activity: Blinking LED using Altera Cyclone IV FPGA DE0-Nano Board

tanishqe
tanishqe
10 Oct 2021

Hi everyone!!

 

Introduction on DE0-Nano Board

 

     The DE0-Nano board introduces a compact-sized FPGA development platform suited for a wide range of portable design projects, such as robots and mobile projects.

 

     The DE0-Nano is ideal for use with embedded soft processors—it features a powerful Altera Cyclone IV FPGA (with 22,320 logic elements), 32 MB of SDRAM, 2 Kb EEPROM, and a 64 Mb serial configuration memory device. For connecting to real-world sensors the DE0-Nano includes a National Semiconductor 8-channel 12-bit A/D converter, and it also features an Analog Devices 13-bit, 3-axis accelerometer device.

 

     The DE0-Nano board includes a built-in USB Blaster for FPGA programming, and the board can be powered either from this USB port or by an external power source. The board includes expansion headers that can be used to attach various Terasic daughter cards or other devices, such as motors and actuators. Inputs and outputs include 2 pushbuttons, 8 user LEDs, and a set of 4 dip-switches.


About my Mini Project

     I am starting with a warm-up activity to blink a LED using a 50MHz clock crystal oscillator and I am planning to release mini-project series.

 

     Since the clock frequency is of 50Megahertz, using a 32bit counter to count ''+1" for every positive edge of the clock pulse, to make it run for 2500000 times i.e., 0.5 seconds would have passed. For every change in the state of the LED(ON/OFF), the 32bit counter is initialized to 'zero' and counts 2500000 until the state of the LED is inverted. So, for a LED to ON and OFF together takes 1 second.

 

Software used: Quartus Prime 20.1 along with Modelsim

Coding Language: Verilog HDL

 

Code:

 

module LED_Blink

(

     input clk, rst,

     output out

);

 

reg [31:0] counter;

reg LED;

 

initial

begin

     LED = 1'b0;

     counter = 32'b0;

end

 

always @ (posedge(clk))

begin

     if(rst==1)                //hold the current state of LED

     begin

          if(counter<2500000)

               counter <= counter + 1'b1;

          else

          begin

               LED <= !LED;

               counter <= 32'b0;

          end

     end

     else

          counter <= 32'b0;

end

 

assign out = LED;

 

endmodule

 

Output Video

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Please comment on my flaws or suggestions if any. image

Also, suggest to me some great mini projects

Thank you for your support guys!  

  • Sign in to reply
  • tanishqe
    tanishqe over 3 years ago in reply to michaelkellett

    It was really helpful Michael Kellett

     

    Yes, I'll also add a test bench and make a simulation for the upcoming mini-projects.

    Definitely, I'll get my hands full with ADC in a little while!

    Thank you image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 3 years ago

    It's always nice when the first LED blinks.

     

    I have a couple of suggestions that may be helpful:

     

    1) when you post code try using the >> control with the Syntax Highlighting option, it will make bigger chunks of code much easier for people to read.

     

    2) get into the habit of simulating your code, for a little project like this it wont do much for you, for bigger things it's essential

     

    3) a really good mini project would be to get that ADC working, using 100% your own code, not the stuff that comes with the board. You'll need to get and understand the data sheet for the ADC and to make a decent simulation testbench you will need to make a model of the ADC.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube