5090

This is the stand-alone version of the original one.

Motivation
My original version relied upon a PC for display and power supply. This version has its own display and battery. It can be used anywhere without additional hardware.

Hardware.
My original plan was to connect an LCD with a serial connection (this one) to the original version, but using a bigger microcontroller (with more pins) turned out to be better. The final version is using a PIC16F1847 and a 2-line HD44780 LCD on one of my universal PCB's (found here). A set of three AA-size batteries is used as power supply to create a real stand-alone device. The on/off switch is a toggle with middle position (on)-off-(on) but two buttons can also be used. If on but not in use the power is switched off after 1 minute automatically to save batteries. A running chess-timer or stopwatch is of course not switched off.
Not shown in the schematic: all switches and the LED connect to ground. Power is connected to ST1 (1=plus, 2=minus). ST2 can be used to program the PIC or may be omitted if not needed.

Software.
The program is written for the B. Knudsen CC5X compiler. Source and hex-file are included in the zip. Because 16-bit pointers are needed for the constants the program must be compiled with the -mc2 option. An example bat-file to show this is also included.
The switch-off time can be simply changed because the devices watchdog is used for this purpose. My choice was to select 64 seconds, but max. 256 seconds is possible by setting WDTCON to 0b00100100.

Operation:
There are 3 buttons for the operation of the device; left/P1: player 1 or start, right/P2: player 2 or stop and middle/P3: setup or select.

This version contains 5 game assistants:
  1.  reaction timer: press P1 to start a random time of 1-10 seconds. Immediately after expiration P2 must be pressed. The elapsed time is displayed with an resolution of 0.01 second. If P2 is pressed too soon "ERROR!" is displayed. There are 4 modes to show the start of the measurement: LED on, buzzer on, LED off or buzzer off. The actual mode is shown on the top line.
  2. chess clock: the game is started (and eventually halted) by pressing P3. The time for player 1 starts running, As soon as player 1 is ready P1 is pressed which stops the timer 1 and starts timer 2. Because of the limitation of the free C-compiler max. time for a player is 1.5 hour. A max. time for a player or for a turn can be selected during setup.
  3. stopwatch: Start with P1, stop with P2 and reset (if stopped) with P3. Resolution is 0.1 second and the max. time which can be displayed is 1.5 hour.
  4. quizmaster: the answering time is started by pressing P3. The player who presses first (P1 or P2) is displayed. Eventually a max. answering time can be setup.
  5.  dice: the result is show after pressing P1 or P2. It is possible to throw 1 die, 2 dice or a random number (1-10, 1-25, 1-49 or 1-100) selected by setup.

Setup is started by holding P3 during switch on. The button can be released as soon as the buzzer sounds. On the upper line the selected game is displayed plus eventual mode, on the lower line the menu ("start  set +play"). Start the selected game by pressing P1, select another game by pressing P2 and setup the selected game by pressing P3. After setup P3 is pressed another time to return to the main setup menu.
If the game assistant is switched on without P3 the selected game is immediately started.