Shot Clock, Game Clock and Scoreboard using PIC16F877a
A basketball shot clock, game clock and scoreboard circuit and program made using 2 PIC16F877a and 2 LCD (LM016L) displays.
For scoring, a selector switch is used to score home or away teams. Increments can be by 1, 2 or 3. A decrement by 1 switch is also available if score needs to be reduced. The quarter switch changes the QTR display.
In the clock, SET GAME switch can be used to set the game clock. POSSESSION switch on the other hard can be used if the there is a change in possession. In this case, game clock stops and shot clock resets to 24. DEAD BALL switch can be used if there is a dead ball situation. In this case, the game clock pauses and shot clock retains. Finally, a 14-SECOND SHOT CLOCK switch can be used if shot clock needs to be set to 14 seconds. FOUL switch can be used to increment fouls.
For scoreboard function, it is just an increment function to the score of the selected team selected by the TEAM selector switch.
For the game clock workaround, it is controlled by DEAD BALL switch. When the clock runs out, the QTR switch will reset the clock back to the set number of minutes.
For the shot clock, DEAD BALL, 14-SECOND and RESET switch are available. DEAD BALL simply breaks the increment function of the game clock. 14-SECOND just re-sets the game clock to 14 and RESET on the other hand re-sets it to 24 seconds.
The foul switch simply increments the number of fouls of the selected team using the TEAM SELECTOR. If it reaches 6 and above, it will display PNTY. The fouls would reset if the QTR switch is pressed.
This circuit uses LCDs as output, but if you want to use 7-segments, it is also possible. Just use decoders for those segments and tweak the code for pin assignments and you'd still get the same functionality of the shot clock, game clock and scoreboard.
The program was done in PIC Simulator and the circuit was made and simulated in PROTEUS.
Download here.