A clock divider turns 1 MHz into 100 Hz, which drives a stopwatch going from 00:00:00 to 59:59:99. To achieve this, a chain of two types of counting circuit, one per digit gives it's output to an SPI master that encodes the result to be displayed on a 7-segment display with at least 6 digits.
The start/stop button toggles the clock, the lap time button pauses the display, while the clock keeps running in the background. Pressing it again re-enables the display. The time can be reset with the reset button on input 2, or with the chip/PCB wide reset. The PCB wide reset affects everything, the input pin driven reset does only resets the counters.
2-3 buttons, one for start/stop and one for lap times. For the reset, either a third button or the dev board's reset for the whole chip can be used. 1 MAX7219/MAX7221 driven 7-segment display, or something that can interpret the SPI signal according to the MAX's specifications.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | start/stop | SPI MOSI | |
1 | lap time | SPI CS (active low) | |
2 | reset (active high) | SPI CLK | |
3 | skip display setup (only output time, active high during reset) | stopwatch enabled (counting up) | |
4 | display enabled (goes low when showing lap time) | ||
5 | |||
6 | |||
7 |