Forum Discussion
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'; ...