Altera_Forum
Honored Contributor
11 years agoNeed help in realizing a simple clock
Dear all,
I found a question in using DE2-115 board and need your help. (I attached my source file ".v" in the for your information) Brief intro of the files: Top: lab2_DE115.v Goal: realize a simple clock, use the HEX LEDs on the board to show Hour: Min: Sec. If the Hour: Min: Sec reaches to 23:59:59, in the next second, the clock will go back to 00:00:00. Implementation: I used the DE2-115 embedded clock(50MHz), by (clock_divider.v, divide_by_50.v and divide_by_10.v) divide it to obtain 1sec per period. Then I used "ninth_counter.v and fifth_counter.v" to form the minutes and sec into 0-59:0-59. Then I use hex_7seg.v to show the Hour:Min:Sec output into the LEDs. Issue: I could not figure out how I can reset the the clock to "00:00:00" after it reaches to "23:59:59". More details: I created a signal: DAYSET and a subprogram: calladay.v. When the time reaches to "23:59:59", DAYSET will changes to "~DAYSET". I would like to use the changes in DAYSET to reset all of the digits of "Hour:Min:Sec". However, I could not figure out how I can insert the DAYSET into the functions. I tried several ways but the Quartus II always says I have some syntax error. Could anyone take a look at my code and give me some suggestions! Thanks!