Custom build PicoChess computer - board interface

292 views
Skip to first unread message

clarke baxter

unread,
Oct 21, 2021, 4:11:45 AM10/21/21
to PicoChess
Hi All
I am looking for guidance regarding the interface between PicoChess and the connected board.

My winter project is to build a self-contained PicoChess machine with auto-sensory (reed switch) board and built-in screen.

I have a prototype board working with a Teensy 4.1 micro controller and I'm currently working on the logic to properly translate the changing states to 'moves'.

At some point I have to make the board talk to PicoChess. It is easy to set up the Teensy as a USB device and send data to the host, but what form should that data take?

More specifically:
  • is there a pre-amble between PicoChess and the board?
  • what form does PicoChess expect for the moves?
  • to what extent does the board have to validate the moves?
I am hoping for pointers rather than expecting in-depth answers, although any help will be gratefully received.

Finally, is there a block diagram showing the architecture of PicoChess?

cb


Dirk Sommerfeld

unread,
Oct 25, 2021, 9:39:39 AM10/25/21
to PicoChess
Hi Simon,
all what you need you will find in the picochess board.py 
Also a good help to understood what the board is doing you will find on 
The last one is the Github code from the developer of the Revelation.
Best Dirk

clarke baxter

unread,
Oct 25, 2021, 2:12:58 PM10/25/21
to PicoChess
Hi Dirk

Thank you for the leads, much appreciated. It looks quite complicated. Perhaps it will be a winter, autumn and spring project.

I'm having loads of fun with my prototype board and the Teensy. So many ways for it to be wrong!

I made a big mistake in buying cheap reed switches. Some of them work perfectly.

cb

Marcin Jasiński

unread,
Oct 25, 2021, 7:42:41 PM10/25/21
to PicoChess

I used a hall sensor once, it works fine

Dirk Sommerfeld

unread,
Oct 26, 2021, 2:15:30 AM10/26/21
to PicoChess
Hi Simon,

keep calm... If you look a little deeper in the code , you will follow them. It's traveling in a world of hex codes, but I'm sure you did it.

Dirk

clarke baxter

unread,
Jan 16, 2022, 7:07:34 PM1/16/22
to PicoChess
Don't laugh...

This was my first prototype for the board. Carboard base with stiff wire - what a mess.

DSC02602.jpg

It did work though, after a fashion. I learnt enough to make me think I could do better with reed switches that didn't stick closed or open.

So my next attempt was built on a clear polycarbonate plastic sheet. I backed it with paper then laid out tracks with Kapton tape for insulation and slug tape for conductors.
Slug tape is a wonderful thing and I had no idea. It just loves solder!

The micro-controller is a Teensy 4.1.

Capture.PNG

A board design printed on posh photo paper for the playing surface, and a little tft screen mounted underneath the plastic.

Capture.PNG

You may recognise the pieces - they are from my Centaur. I did a non-destructive modification with magnets and sticky back velour on the existing bases.

It allows slides and captures either way. Even a zig-zag slide with a flourish works! Now that would be an annoying trait in an opponent.

After that I lost my way somewhat. The plan was to make the board talk to PicoChess, but I was really struggling with understanding the Python code. So instead I started coding on the Teensy to not just generate moves, but to only allow legal moves.

The current state...
Capture.PNG
Buzzer (very annoying) and twirly button thingy added for menus. Not so pretty on the top, but easier to see and operate. No menus yet... lost my way again.

It recognises illegal moves, checks and discovered checks. It allows castling and en-passant moves and it generates and consumes FEN strings. it passes moves via USB to my Rapsberry Pi where a little Python script (yes I am learning, but the basis of it was cribbed from StackOverflow) passes the moves to Stockfish, and sends back the responses.

I haven't coded for checkmate or stalemate - seems rather daunting for me and the Teensy. Even in the current state I can play a game to conclusion - usually a loss.

My intention is still to build a highly polished wooden stand-alone board with Pico Chess built in. I want the engines, PicoTutor and move announcements. 

Anyway, I'm having loads of fun on the way.

cb

RandyR

unread,
Jan 17, 2022, 12:33:24 PM1/17/22
to PicoChess
Very impressive, Clarke. Thanks for sharing.

Randy

Reply all
Reply to author
Forward
Message has been deleted
0 new messages