Playing chess on a microcontroller

[Arthur Benemann] started a little project for his electrical engineering program, and suffered the worst case of feature creep we’ve ever seen. He just posted an instructable of his picChess project that is able to play chess on a VGA monitor with a keyboard, with sound, a clock, temperature sensor. Apparently, [Arthur] was bored one evening and threw in an implementation of Conway’s game of life.

[Arthur] chose a DSPIC33F μC for his project with everything laid out on a bread board. He’s quite proud of his VGA routine, the first time he’s ever used DMA. We’re really impressed by [Arthur]‘s chess engine – his is the first homebrew chess engine we’ve seen on Hack A Day. Although the engine is a brute-force search with Alpha-beta pruning, the engine itself seems fairly advanced that will even supports castling.

Although a few rules aren’t supported and the ELO rating of the engine isn’t known, [Arthur]‘s engine should still be able to beat an amateur player. A fairly impressive feat indeed.

Check out [Arthur]‘s video after the break.

Comments

  1. Hackerspacer says:

    “temperature sensor”?

    Uhh? What possible purpose does that serve?

  2. evs says:

    temp sensor is either for oscillator temp compensation, or he just felt like adding it/had to for his class.

  3. Arthur Benemann says:

    I was just trying to use most peripherals, there is a screen where a analog clock showing the current time and date, I thought an environment temperature reading would be nice and would make me use the ADC of the pic ( the temp. sensor is a LM35).

  4. Koplimi says:

    @Hackerspacer
    To study if “The heat of the moment” actually occurs in a chess game.

  5. don says:

    Good one!

  6. Hackerspacer says:

    *facepalm*

  7. 1000100 1000001 1010110 1000101 says:

    Pretty damn impressive

  8. Chris says:

    Amazing!

  9. Pilotgeek says:

    I dig the Duke sound clip. This whole project is full of win.

  10. Now all he needs to do is make it run on one of those old LCD screens from a broken laptop which there seem to be a lot of in the WEEE bins here.

  11. Farkanoid says:

    Holy cow, a hack featuring a dsPIC! I wish more of these are posted, they’re a great family of chips, pretty cheap too considering the featureset

  12. Mayor Defacto says:

    ftw

  13. Arthur Benemann says:

    When selecting the deep of search the sound are the same as Duke Nukem 3D.

    If I had a screen at hand I would do it, a graphic LCD would be nice.

    The dsPIc family its nice, but no DSP functions are used in this project. The new microchip family PIC24E, would better suited to this project.It’s DMA can access 4k of RAM, and the run up to 60 MIPs

  14. FredP says:

    From the text:

    ————————
    Although the engine is a brute-force search with Alpha-beta pruning, the engine itself seems fairly advanced that will even supports castling.
    ————————

    First, there’s the completely screwed up “that will even supports castling.” No one noticed this epic bit of word farting? Second, there’s the question of the quality of the engine. Is the engine just some brute force thing, or is it an advanced engine? It can’t be both. It *can* be a brute force engine with an advanced feature or two, but you can’t describe the engine itself as both brute force and advanced.

    Also, this is also from the text:

    ————————
    … able to play chess on a VGA monitor with a keyboard, with sound, a clock, temperature sensor.
    ————————

    Seriously, that sentence is totally screwed up. There’s the obvious lack of “and a” before the word temperature, but in general it reads like something a 4th grader wrote. How about something grammatically and syntactically correct such as:

    ————————
    … able to play chess on a VGA monitor while also supporting peripherals like a keyboard, sound, clock, and a temperature sensor.
    ————————

    Come on guys, you constantly get knocked for poor writing and you *still* can’t be bothered proofreading your stuff? Isn’t there an editor at Hackaday? That’s one of the things an editor is supposed to do – proofread. Why not set a policy that no article get published until at least two other people have read and signed off on it?

    You’re not really generating that much content (in terms of raw word count) per day, so there’s really no excuse for the constant errors in spelling, grammar, and syntax.

  15. Huachinango says:

    Damn boy you are good

  16. shelley says:

    “He just posted an instructable of his picChess project that is able to play” a game very similar to chess “on a VGA monitor with a keyboard, with sound, a clock, temperature sensor.”

    FTFY

    http://www.fide.com/component/handbook/?id=124&view=article

    actually (forgiving three-fold repetition and the fifty-move rule which are arbitrary drawing rules as opposed to the piece movement rules) if it doesn’t support en passant capturing then it’s not even playing chess, it’s playing a game similar to chess that actually eases the burden on a defender.

    from the wikipedia article on en passant linked in the above article:
    “This rule was added in the 15th century when the rule giving pawns the option of initially moving two squares was introduced. It prevents a pawn from using the two-square move to pass another pawn without the risk of being captured (Hooper & Whyld 1992:124).”

    ftfy :P

  17. cgimark says:

    For the chess routines the easiest thing to do is use gnuchess. It runs well even on the older 8051 chips.

    http://ftp.gnu.org/pub/gnu/chess/

  18. jwrm22 says:

    There are some nice chess engine source code available on the web, written in C. Here is one used in a 8bit AVR: http://www.elektor.com/magazines/2009/november/avr-max-chess-computer.1115323.lynkx

    ATM I’m working on converting it to a PIC18F with some of my own features. (special chess games wouldn’t have to be a problem.)

    Nice project!

  19. Arthur Benemann says:

    Most people don’t even know what is ‘en passant’.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,401 other followers