Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI want to use clock oscillator...
Hi. I have DE0 board and it has 50MHz clock oscillator. I want to make a digital clock, and I know How to change 50MHZ to 1Hz, But I don't know how to make the 50MHz oscillator start. When i p...
Altera_Forum
Honored Contributor
13 years agoto slow down your clock:
process(n_clr, clk) begin if(n_clr='0') then cont_reg <= ( others => '0' ); elsif(clk'event and clk='1') then cont_reg <= cont_prox; end if; end process; cont_prox <= cont_reg + 1 when ( cont_reg < 50000000 and cont_on='1' ) else ( others => '0' ) when ( cont_reg = 50000000 and cont_on='1' ) else cont_reg; tick_1s = '1' when ( cont_reg = 50000000 ) else '0'; to start your clock with a button make a state machine: process... if(n_clr='0') then est_reg = ini; elsif(clk.... est_reg <= est_prox; end.... process(... est_prox <= est_reg; cont_on <= '0'; case est_reg is when ini => if (button ='0' ) then est_prox <= contando; end if; when contando => cont_on <='1'; ...