[Home] [Solution - Stopwatch] [Solution 2]
Solution 2
Up ]

 
 

 

  •  My solution can be downloaded and tested at the BASYS board:  Stopwatch2.bit

    • [Btn0] = Start/Stop  - Will control the Stopwatch.

    • [Btn1] = Lap time/Clear  - Will show Lap when running or Clear if stopped (examine the state diagram for more details)

    • [Btn3] = Reset - Used only in case of problems with the state machine

The VHDL source code for Muxdisplay_ver3 can be found here: Muxdisplay_ver3.vhd

  •  Toggle_Button3.vhd     Actually will only the Pulse output be used for this design - a new version would be the best actually - please try yourself

The Toggle_Button3 a State Machine which controlled by the "Button" input and removes eventually bouncing from the contact with a 4-bit shiftregister (not part of the State Machine).

The six internal states produces three outputs:
      Toggle:  Changes state for each press of the button.
      Deboun:  Will be "1" when the button pressed or else "0" (Debouched button)
      Pulse:      Like Deboun but will only be "1" for one Clk period after a press.

 

 
 

   

This component produces a "Running light" at the leds in order to present the 1/10 of seconds.

Consider if this functionality should be placed elsewhere in the diagram.

 
   

In order to "freeze" the display for presentation of a Lap-time will the best solution properly be a x-bit Latch which allows the time-data to pass by under normal condition and hold the display each time the Latch high.

 
   

Just as an extra feature would it be nice to have the display-dots perform some kind of blinking in order to indicate the different states of the Watch.