- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm a newbie in this field, i have a problem and i hope that you all can help me.
i wanted to add in countdown timer into the music box that shown at fpga4fun but i have no idea on how to do the coding for the countdown timer, so i need your help. :( i hope that the countdown timer is in VHDL code or you all can give me the VHDL coding and i'll try to change the music box verilog code so that i can add in the VHDL code. The countdown timer that i want is when i turn on the music box it will countdown 5 second, after countdown it will start to play music. thanks you very much for your help :)Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using a dev. board? What is the frequency of the fpga clock? The timer is based on the clock period. The code looks like:
entity.... architecture arch of ent_name is begin process(rst, clk) begin if(rst='1') then cont_reg <= ( others=>'0'); elsif(clk'event and clk='1') else cont_reg <= cont_prox; end if; end process; cont_prox <= cont_reg + 1 when ( cont_reg < timeout ) else cont_reg; start <= '0' when ( cont_reg < timeout ) else '1'; end architecture arch; The signal "start" goes up to '1' when expires the timer. you enable the circuit with this signal. The constant timeout depends of clock period.
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