- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need urgent help on how to design a stopwatch that can stop/purse using vhdl code. I will really appreciate any urgent reply to this. Thanks. Waiting for your replies.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use Quartus -> Right click -> Insert template -> Full design -> Counter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I didnt get what you are saying.
I have designed the counter but I want to work on the stop and start botton on the board to stop/start when i press stop/start without holding the button down. I will need quick reply from you and other members of this forum.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add the following lines:
--pseudocode
-- on the clock edge
if start = '1' then -- or may be '0' depending on key logic
start_L <= '1';
elsif stop = '1' then
start_L <= '0';
end if;
if start_L = '1' then
count <= count + 1;
end if;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you make ce input to be for both start/stop/pause or you separate start, stop and purse as different input logic?
I will appreciate your urgent reply- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume CE is clkenable. You can apply it to all clocked registers at same time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can i separate the START AND PURSE with separate input i.e
Start: IN_STD_LOGIC PAUSE: IN_STD_LOGIC- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can start, stop, reset, freeze reverse,...etc at will by choosing a switch for each decision
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is not working out at. I want to the button start to be pressed once and it will purse. I have been able to do it that if i press it down, it will purse. Now I want a code for CLockenable that can stop the counter, like clear it without changing and if i press it again, it should be able to start.
Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is not working out . I want the button start to be pressed once and it will purse. I have been able to do it such that if i press it down, it will purse. Now I want a code for CLockenable that can stop the counter, like clear it and if i press it again, it should start.
thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in that case it should not be called clock enable.
-- on clock edge if sw = '1' then toggle <= not toggle; end if; if toggle = '1' then count <= 0; else count up... you will need to manage the logic of various switches now with care otherwise they might get in conflict. This where simulations helps.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how can i design the clock such that if i press pause at intial state, there should be something to remember that state so that Wwhen i do that, the button will change to the next state i.e 1 to 0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is majoprly on the start./stop and nothint else. thats all i need for now.
Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
anybody with idea on how to implement this. I need it urgent.
or If you know how to apply flip flop, logic gate to manipulate the start and stop button, I will appreciate it. Thanks one switch represent start and stop. All I want is that instead of holding the switch down to stop counting, I want it to stop counting if I also remove my hand. and again If I do same thing, i want it to start counting.... Please If you know what I mean, kindly help me out. Thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The best way to achieve what you are asking is to draw yourself a flow chart. If you are looking for an on/off button with just one push then you would have something like this.
process(clk) begin
if(rising_edge(clk)) then
button_prev <= button_curr;
button_curr <= button;
end if;
end process
Button_pulse <= button_curr AND (NOT button_prev);
Now, you can register the pulse, add debounce, ect. It is up to you. Next, you need to create a state machine to handle the enable to your counter. From what you've described you have 2 states, on and off. you start in the off state, if the button_pulse = 1 then you go to the on state and again if the button pulse is 1 you go back to the off state. Then you describe your counter enable as 1 when in the on state and 0 when in the off. I recommend drawing this out and then creating your state machine to match your diagram.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page