Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 Discussions

Using internal Clock of DE2 in Quartus-Verilog

Altera_Forum
Honored Contributor II
5,095 Views

Hi there, I'm very new to verilog and quartus, but I'm trying to build a digital clock. 

 

I've set up the counters (I think) for seconds minutes and hours. 

 

But what I am unsure about is how to use the internal clock to count seconds. 

 

Here are some questions that I have: 

 

1.How do I access the clock in Quartus? From what I have been reading it's an input Port I have to use called CLOCK_50 if I want to use the 50 mHz clock? 

 

2.I used a clock divider to try to increment the seconds counter every 50,000 posedge changes of the clock so that I can achieve a 1 Khz clock, would that be slow enough to emulate seconds? (I assumed the clock is 50 mhz) 

 

3. Do I have to do anything special to use the clock, like "import" anything or use any special modules? 

 

Thank you for your time.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
3,244 Views

thought these would be easy questions. 

 

Any help is appreciated!
0 Kudos
Altera_Forum
Honored Contributor II
3,244 Views

I'm by no mean an expert, but I think I can help with some things... 

 

1. To access the clock, just declare a input pin named CLOCK_50. 

i.e.: CLOCK_50: IN STD_LOGIC; 

 

2. If you want to increment a variable every second, you need a 1hz clock, not 1KHz. A simple but not efficient way to do that is to count every clock until 50.000.000. At this you will have one second. Don't forget to zero your counter. 

 

3. You must set the FPGA pins attached to the oscilator. You can just import the DE2_pin_assignments.csv, available on the DE2 disc. To do so, go on "Assignments - Import Assignments" . 

 

If I said something wrong, please someone correct me. 

 

Hope I can help.
0 Kudos
Altera_Forum
Honored Contributor II
3,244 Views

does this mean the de2 has an internal clock so no external clock will be needed

0 Kudos
Altera_Forum
Honored Contributor II
3,244 Views

The DE2 has an on-board clock source connected to an FPGA pin. 

 

This thread has an example top-level design for the DE2-70 board; 

 

http://www.alteraforum.com/forum/showthread.php?t=33462 

 

Take a look at Post#5. It has instructions on how to build the design. 

 

The design does not have a hours-minutes-seconds clock, but it does control the LEDs and hex-displays, so it will give you a good starting point. 

 

Cheers, 

Dave
0 Kudos
Reply