SolusChess Firmware

SolusChess version 2

In the section Programming Ideas you can obtain the information needed to make your own code. Or perhaps you prefer to use this program I've made.

An initial version exists but has been removed from this website. With this version 2, now the capture can be done in a natural way, in any order. Starting from any position on the chessboard, the program is able to detect "normal" and en passant captures, castling, etc., sending only the correct moves to the host. All this by analyzing the changes on the sensor matrix, without piece identification (unlike DGT chessboards). Thus the legality of the moves remains the responsibility of the player. ;-)

Table of Contents:

FIRST

The program is very simple, with the advantages and disadvantages that this entails: it just emulates a USB keyboard.

Before building this project I suggest you to do the following:

  • Check that your chess program for PC (or Tablet, Smartphone, ...) supports the move input via keyboard.

  • If so, configure the program properly: some programs are not, by default. It's essential that the program "listen" only complete moves (eg "e2e4") rather than partial (eg "e4"). With Arena Chess GUI, for example, this is accomplished as follows:

  • Play using only the keyboard, without touching the mouse! Insert moves as, for example, "g1f3". The commands entered must be simple, by way of coordinates ("origin_square""destination_square"), without any letter indicating the capture, the piece, etc. Try to capture pieces, to promote a pawn, the castling, etc.

  • Test also to disable chess engine, like you're playing against someone else: you have to make your move and the opponent's.

  • Make mistakes intentionally: introduce the move of a piece that is not yours, make an illegal move, etc.

  • Draw conclusions about the limitations that this system has.

Did it work for you? Then go ahead... Keep reading!

WHAT IT OFFERS?

By emulating a USB keyboard, it meets the following conditions:

  1. It sends simple commands like e2e4 ("origin_square""destination_square"), ie, chessboard coordinates (pure algebraic coordinate notation).

  2. It works with any chess program which supports keyboard input, whether for PC, Tablet, Smartphone, etc.

  3. By default, at boot, it operates in the following way (all these parameters can be configured):

    • Player is WHITE, and it has the turn.

    • Opponent is a COMPUTER, so the program will only send player's move: one in two.

    • In castling it will only send the King move, ie, the Rook move is skipped. For example it will send "e1g1" in White kingside castling.

    • Sending an ENTER key after every move.

  4. After startup, it remains in Setup Mode until the first valid move is made (one in which "destination" and "origin" squares are different)

  5. Once the game has started (after the first valid move), a piece can be lifted and return to place in the same square without this being a problem: the move is considered invalid and its sending is ignored.

LIMITATIONS

SolusChess performs continuous scans on the chessboard to determine where there is a piece and where there isn't. Based on changes in the 64 squares matrix, it decides whether to send a move and how do it, detecting special situations like castling, en passant capture, etc. But there's a series of limitations inherent to the design, that you have to know:

  • There is no piece recognition like in DGT chessboards, TASC, etc. with all that this entails.

  • The pieces cannot be "dragged" onto the chessboard. DGT e-board yes allow it, thanks to piece recognition and a time delay in reading.

CONFIGURATION

While the chessboard is in SETUP MODE (starting from about 4 seconds after USB connection, until the first valid move is made), the program will "listen" all moves which consist of lift a piece and place again in the same square, which will cause the setting of some parameters.

You can return to Setup Mode at any time by pressing the NEW GAME pushbutton (if installed).

Some of these settings are also configurable by pressing a pushbutton, in case you have made the right wiring: see section Teensy USB Development Board.

PLAYING

  • CAPTURE: starting from SolusChess version 2, the capture can be done in a natural way, in the order that is most comfortable to the player. The same applies to en passant capture.

  • PROMOTION: it depends entirely on the PC chess program used. In some programs is as simple as moving the pawn to the last row, then replacing by the new piece, and finally indicating the chosen piece in the PC program: for example in Fritz the election is via a dialog box.

  • In Arena Chess GUI, however, it's different: it expects a command like "g7g8Q". In this case the solution would be to move the pawn normally, then replacing with the new piece, and then pressing on the keyboard the corresponding letter ('Q' for the Queen, for example). You could also make the move with the mouse.

  • CASTLING: has to be done with total normality, because the program automatically detects castling and makes two corrections: avoids sending of Rook move (default setting), and prevents desynchronization in the turn (since the same player moves twice).

  • SETTING UP POSITION: it's possible to arrange the pieces on the chessboard in a particular way to study a game or to continue one already started. First is best to unplug the USB cable, then making the same arrangement in the computer chess program than in the chessboard. It should take into account of whose turn is it. Then you can plug the USB cable, in order to play normally. If you installed the NEW GAME pushbutton is much simpler: just set up the pieces correctly on the chessboard and on the PC program by matching the turn, and press NEW GAME pushbutton.

  • CORRECTING ERRORS: at any time you can correct an error on the chessboard, then pressing the RE-INSTATE pushbutton (if installed). This pushbutton causes a new exploration of the position of the pieces and, in addition, it changes the turn, so you have to press an even number of times if you want to leave the turn at the same side. Regarding the PC program, some allow the deletion of the last commands entered by pressing the "Backspace" key (Arena GUI), other using the "Delete" key (Fritz), etc.

CONTROLS

  • PROGRAM: it performs the same function as the pushbutton integrated into Teensy board, that is, it reboots the microcontroller in "programming mode": this avoids having to remove the bottom cover every time we need to reprogram.

  • RE-INSTATE: sometimes SolusChess program can "be lost": because we have made a mistake moving a piece, or we have accidentally dropped it, or the PC program doesn't understand a move, etc. By acting on this pushbutton the program performs a full scan of the board to check where there are pieces and where are not, and in addition it changes the player turn. The latter is important because I have found that many errors are caused by desynchronization of the player turn when we're playing against the computer. If you don't want to change the turn, you can push a second time and solved, ie, by pressing an even number of times. The change in the turn caused by the use of this control, should not be used to "Flip the Board".

Internally the program makes the following changes:

    • Removes uncompleted moves

    • Resets the detection of castling

    • Rescan the chessboard

    • Swaps the game turn


  • NEW GAME: allows you to reset the program in order to start a new game and it also activates the "Setup Mode".

Internally the program...

Keeps UNCHANGED the following parameters:

  • Opponent (COMPUTER/HUMAN)

  • Sending of ENTER (YES/NO)

Makes the following changes:

          • Deletion of incompleted moves

          • Reset of Castling detection

          • Rescan of the chessboard

          • Set Player=WHITE

          • Set Turn=PLAYER

          • Activation of Setup Mode


  • FLIP BOARD: it exchanges the squares A1 and H8, ie, lets you play with White or Black.

  • SELECT OPPONENT: it allows you to choose between HUMAN or COMPUTER opponent. The role of this option is to decide if the program should only send player move, or also the opponent move, in order to allow saving the game.

  • TOGGLE ENTER: to choose whether we want to send an ENTER key after each move. There are PC chess programs that need it and others who do not.

  • RESERVED: control reserved for future, or experimental, functions of SolusChess.

  • LEDs: a LED installed on the player side and another one on the opponent side, can help us to know who is the turn, avoiding making a mistake especially when we play against a computer. Also I have taken advantage using them as feedback indicators, for example when configuring the program (Startup Options) or pressing some pushbuttons.

DOWNLOAD

Teensy 2.0
v2.1
(2014-06-04): soluschess_T2.0_PvC.hex

Teensy++ 2.0
v2.1
(2014-06-04): soluschess_T2.0pp_PvC.hex

You can also download Customized versions of SolusChess firmware: Link

Programming the microcontroller is simple with the following application, which requires no installation:

FIRST STEPS

Before you start to fight with a chess program in particular, it's advisable to test with simple text editor: open the editor, plug the USB cable to the chessboard and test!

Remember: By default SolusChess doesn't send "opponent" move, as it supposes that you are playing against a chess program for PC, who doesn't want to receive its own moves.

USING ARENA CHESS GUI

Official Site: Arena Chess GUI

We have to set up Arena Chess as follows, so that it "listen" what SolusChess is sending.

Enable the keyboard input, with the option "Only evaluate complete moves".

You should monitor what is actually receiving Arena Chess by looking at the bottom right box. You can understand what is wrong with just taking a look at this text box:

A white pawn reaches the last row and SolusChess sends "g7g8", but Arena expects something more...

Using the keyboard, by pressing "Q", we indicate we want to promote to a Queen.