chess clock coding using quartus II

Discussion in 'Programmer's Corner' started by cempaka, Aug 28, 2008.

  1. cempaka

    Thread Starter New Member

    Aug 28, 2008
    3
    0
    i have a problem in coding for the digital chess clock...
    should it started with coding for a clock?or a timer?
     
  2. RiJoRI

    Well-Known Member

    Aug 15, 2007
    536
    26
    When I play, I play "untimed chess," so I can remember how the pieces are supposed to move! :D

    Timed chess allows a certain amount of time for each player's moves, right? So what you would want is a counter, and most likely a down-counter. A reset/restart switch would also be good - slap the switch (like a snooze button on a clock) and the timer restarts.

    --Rich
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The first thing you must have is a very accurate timebase. An OCXO (Oven Controlled Crystal Oscillator) will provide a fairly stable timebase, but it must be operating for a few hours before stability is achieved. TCXO's (Temperature Compensated Crystal Oscillators) might be more practical for a portable chess timer, but they will not be as accurate. However, they will probably suffice for an informal game.

    Here's a link that will give you some ideas on how they're used:
    http://chess.about.com/library/weekly/aa03c01.htm
    There are a lot of options you could program in.
    [eta]
    See this page; US Chess Federation clock rules:
    http://www.uschess.org/tds/clockrules.php
    The page may be outdated, but it's a good start.
     
    Last edited: Aug 29, 2008
  4. cempaka

    Thread Starter New Member

    Aug 28, 2008
    3
    0
    arrghh...
    i dont think i can start it all back because i have no time on it...i have to do it based on my acknowledge now and the knowledge that u all give me..

    firstly, do i have to start it with state diagram?how many state diagram does it have?
     
  5. RiJoRI

    Well-Known Member

    Aug 15, 2007
    536
    26
    (Just back from the Labor Day holiday)

    No, you do not NEED to start with a state diagram. Any diagramming tool is to help you understand what the software needs to do. I would start by writing down how the clock needs to work. Put in as much information as possible. (You are basically writing a spec for yourself.) Look it over, think about it, and you may decide the best way to diagram the operation is with a state diagram, or maybe you can jump into a flow chart, or some other method.

    --Rich
     
  6. cempaka

    Thread Starter New Member

    Aug 28, 2008
    3
    0
    i'm totally dont know what to do now..really in stressed...
     
  7. RiJoRI

    Well-Known Member

    Aug 15, 2007
    536
    26
    Take a deep breath, hold it for 20 minutes. :D

    First, describe what the clock needs to do, and post it here. I have my guesses as to what's needed, but my guesses may not be right. Don't leave out things like any time display, switches, buzzers, etc.

    For instance, "The clock needs to count from 75 seconds down to 0. The time remaining should be shown on a 7-segment LCD display. When the clock reaches 00 seconds, a chime should sound. A reset button should be on top of the clock to restart the 75 second time."

    Once this is cleared up, we can go to the electronics portion.

    Relax! This is truly a simple problem, and there are many good people here who can aid you, once the problem is fully described.

    --Rich
    P.S. -- school is just starting here on Long Island, and I remember slightly panicking on the first day when we would get our books: How in the world was I to learn all of this? Somehow, by the end of the year I had. ;)
     
Loading...