EGRE 365

Lab 7 – Stopwatch

Assigned 10/2/09

To be completed by 10/9/08

Report due at the beginning of class on 10/13/09

Name(s): ______

You have two weeks to complete this lab; however, the first signoff must be completed today. A formal lab report is required. You may work with a partner, and turn in a single joint lab report. The lab report must include you final source code, and a through description of the modifications you made to obtain the final code. Both partners must demonstrate a working version of the program on the Nexys 2 board before or during the next lab period and receive the final signoff. You must include this signed off sheet along with you source code in the lab report which will be due at the beginning of class on October 13th. In this lab you will use as a starting point the design from Lab 6. Take advantage of the components in n_parts_v1.vhd, but do not make changes to the n_parts_v1.vhd file!

Your Lab 7 program must satisfy the following specifications:

Using the Digilent Nexys 2 board you will implement a stopwatch. The seven-segment display will display the elapsed time in hundredth of seconds in the format of 00.00 to 99.99. BTN3 acts as a start button. BTN2 acts as a stop button. BTN1 acts as a reset button. Pressing the START button will cause the stopwatch to enter the run mode and the display will count in decimal each .01 sec starting at its current count. The board will continue to count till either the STOP or RESET buttons are pressed. Pressing the STOP button causes the stopwatch to enter the stop mode and will stop the count at its current value. If the START button is pressed when in the STOP mode the count should resume at the current value. The RESET button will reset the count to 00.00. If RESET is pressed when the stopwatch is running the count will reset to 00.00 and continue to count. If RESET is pressed when the stopwatch is stopped the count will reset to 00.00 and remain at 00.00 till the start button is pressed. When the count reaches 99.99 the display will blink and continue to display a blinking 99.99 until the RESET button is pressed. IF more than one button is pressed ignore the buttons till only one is pressed. For example if the RUN and STOP buttons are pressed in the following sequence: NONE, RUN, RUN and STOP, RUN only, then NONE. The stopwatch will start running when the RUN button is first pressed and continue to RUN without stopping (i.e. The stopwatch will remain in the RUN mode) . If the sequence is: NONE, RUN, RUN and STOP, STOP only, then none. The stopwatch will start running when the RUN button is first pressed and continue to RUN until only the STOP button is pressed (i.e. The stopwatch will remain in the RUN mode till the only button pressed is the STOP button.)

The Led’s must indicate which button was pressed last. If the last button pressed was:

START – will turn on LD2 and leaves it on till another button is pressed.

STOP – turns on LD1 and leaves it on till another button is pressed.

RESET – turns on LD0 and leaves it on till another button is pressed unless the stopwatch is in the RUN mode in which case only LD2 should remain on; however, LD0 should turn on will the RESET button is pressed.

The board must power on in the reset state.

For this lab you must complete the following tasks:

  1. Create a new project called stopwatch.
  2. Modify the counter form the previous lab to implement a stopwatch. and download the stopwatch .bit file to the Nexys 2.
  3. Run the stopwatch and spend a few minutes determining what is wrong with the stopwatch. Demonstrate the running program to the TA or instructor. Ask for help as needed.

Signoff: ______

  1. Once the program works correctly,demonstrate your working program, and obtain a final signoff.

Signoff: ______

Comments: