- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thought these would be easy questions.
Any help is appreciated!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
does this mean the de2 has an internal clock so no external clock will be needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page