The chess clock mode on my CHESSmate Reproduction is now working. It was relatively easy to simulate the 6530-024 Timer by triggering 240 interrupts each minute, which is what the CHESSmate firmware is expecting.
This accounts for the read to 8B0E (the READ TIMER INTERRUPT register) which clears the current interrupt, and the write to 8B0F (the DIV BY 1024 ENABLE INTERRUPTS register) discovered in my Eureka moment.
Number | R/W | Program Counter | Address | Value | Notes |
---|---|---|---|---|---|
1 | R | F390 | 8B0E | Is Timer Interrupt? | Occurs when a move is made |
2 | W | F0B2 | 8B0F | F5 Set Interrupt | Occurs when move is made |
Writing F5 to the 8B0F register starts a 250 millisecond timer that will trigger an interrupt when it expires. Once the interrupt has been processed a read to 8B0E will clear the interrupt. When the interrupt service routine processes 240 such interrupts, the minute timer for the current player is incremented by 1. The fractional part, 1/240th of a minute is retained between moves.
Chess clock mode is "stand alone" in that you cannot play chess against CHESSmate when you are chess clocking and vice-versa. You get into chess clock mode by pressing C then ENTER. Pressing H starts WHITE's clock running, then pressing A stops WHITE's clock and start's BLACK's clock. H then switches back to WHITE, then A BLACK and so on. You can press the E key to stop the current clock then E again to restart it.
![](https://cdn.hackaday.io/images/5295081707947605378.jpg)
Here we see that BLACK is moving and has used up 2 (+)minutes of their clock. When BLACK is done moving they will press H to switch the clock to WHITE. CHESSmate remembers and applies the fractional part of the time used between moves.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I wonder if ths slowness you experienced with the AVR simulation was due to the lack of a timer?
Are you sure? yes | no
Good thought Ken, but so far as I can tell the timer is only used when the game is in chess timer mode. I think that your original suggestion of too much GPIO activity is probably still the best theory.
Are you sure? yes | no