Close

Testing The CHESSmate PCB

A project log for Commodore CHESSmate Reproduction

The plan is to make a reproduction of the dedicated chess computer CHESSmate released by Commodore in 1978.

michael-gardiMichael Gardi 01/31/2024 at 17:080 Comments

Well the PCBs arrived and I wanted to make sure all of the active components were working, so populated the board and extended my quick and dirty test program. 

#define PA0  7
#define PA1  6
#define PA2  5
#define PA3  4
#define PA4  3
#define PA5  2
#define PA6  1
#define PA7  0

#define ENTER_KEY     8
#define CLEAR_KEY     9
#define NEW_GAME_KEY  10

#define CHECK_LED 11
#define LOSES_LED 12
#define B_W_LED 13

#define DISPLAY_1     A0
#define DISPLAY_2     A1
#define DISPLAY_3     A2
#define DISPLAY_4     A3

#define BUZZER_1      A4
#define BUZZER_2      A5

void setup()
{
   // define pin modes
   pinMode(PA0,OUTPUT);
   pinMode(PA1,OUTPUT);
   pinMode(PA2,OUTPUT);
   pinMode(PA3,OUTPUT);
   pinMode(PA4,OUTPUT);
   pinMode(PA5,OUTPUT);
   pinMode(PA6,OUTPUT);
   pinMode(PA7,OUTPUT);
   pinMode(CHECK_LED,OUTPUT);
   pinMode(LOSES_LED,OUTPUT);
   pinMode(B_W_LED,OUTPUT);
  
   pinMode(DISPLAY_1,OUTPUT);
   pinMode(DISPLAY_2,OUTPUT);
   pinMode(DISPLAY_3,OUTPUT);
   pinMode(DISPLAY_4,OUTPUT);
   
   pinMode(BUZZER_1,OUTPUT);
   pinMode(BUZZER_2,OUTPUT);
  
   pinMode(ENTER_KEY,INPUT_PULLUP);
   pinMode(CLEAR_KEY,INPUT_PULLUP);
   pinMode(NEW_GAME_KEY,INPUT_PULLUP);
}
 

void loop() 
{
  // loop to turn display segments ON one at a time
  digitalWrite(DISPLAY_1,HIGH);
  for(int i=0; i<8; i++) {
    digitalWrite(7-i,HIGH);
    delay(600);
  }
  
  // loop to blink display
  for(int i=0; i<5; i++)
  {
    if (i%2) {
      digitalWrite(DISPLAY_1,HIGH);
      digitalWrite(B_W_LED,LOW);
    } else {
      digitalWrite(DISPLAY_1,LOW);
      digitalWrite(B_W_LED,HIGH);
    }
   delay(600);
  }

  // Test the other LEDS.
  digitalWrite(CHECK_LED,HIGH);
  delay(500);
  digitalWrite(LOSES_LED,HIGH);
  delay(500);
  digitalWrite(CHECK_LED,LOW);
  digitalWrite(LOSES_LED,LOW);
  delay(500);
  
  // Test the other displays.
  digitalWrite(DISPLAY_1,LOW);
  digitalWrite(DISPLAY_2,HIGH);
  delay(500);

  digitalWrite(DISPLAY_2,LOW);
  digitalWrite(DISPLAY_3,HIGH);
  delay(500);
  
  digitalWrite(DISPLAY_3,LOW);
  digitalWrite(DISPLAY_4,HIGH);
  delay(500);
  
  digitalWrite(DISPLAY_1,HIGH);
  digitalWrite(DISPLAY_2,HIGH);
  digitalWrite(DISPLAY_3,HIGH);
  delay(500);

  digitalWrite(DISPLAY_2,LOW);
  digitalWrite(DISPLAY_3,LOW);
  digitalWrite(DISPLAY_4,LOW);
  delay(500);
  
  // Make a tone manually. Half Bridge.
  for(int i=0; i<1000; i++) 
  {
      digitalWrite(BUZZER_1, LOW);
      delay(1);
      digitalWrite(BUZZER_1, HIGH);
      delay(1);
  }
  delay(500);
  
  // Make a tone manually. Full Bridge.
  for(int i=0; i<1000; i++) 
  {
      digitalWrite(BUZZER_1, LOW);
      digitalWrite(BUZZER_2, HIGH);
      delay(1);
      digitalWrite(BUZZER_1, HIGH);
      digitalWrite(BUZZER_2, LOW);
      delay(1);
  }
 
  // loop to turn display segments OFF
  for(int i=0;i<8;i++)
  {
    digitalWrite(i,LOW);
  }

  // Test the NEW GAME button.
  while (digitalRead(NEW_GAME_KEY) == HIGH) {
    delay(100);
  }
}

And the results were good.   

So now all I have to do is make the Arduino Pro Mini pretend to be a 6504 processor running the CHESSmate code and interfacing with the front panel hardware.  Piece of cake ;-)

Discussions