Home | Articles | Projects | Downloads | About

Select the desired language Greek English

Home Projects Homemade Arcade Machine [You are here...]
Homemade AGM - The game machine controller

Write something here


Write some notes here

  • 35 10K resistors 1/4 W (3 + 32 for pull down resistors. See text for more details).
  • Five 9.1K resistors (1/4W). Or five 10K.
  • Four 1K resistors (1/4 W).
  • Four 1F / 16V electrolytic capacitors.
  • Two 100F / 16V electrolytic capacitors.
  • Two 100nF capacitors.
  • Two 22pF capacitors.
  • One 1N4001 diode (or any of 1N400X).
  • Three BC547B BJT Transistors (or three BC337).
  • One BC337 BJT Transistor.
  • One 10MHz piezoelectric crystal.
  • One MAX232.
  • One ATtiny2313 microcorntroller.
  • Four 74HC166.
  • Two 12V/230V Relay switches for PCB boards, about 6-7A.
    The one to the coin acceptor can be smaller.
  • Two tripple terminal blocks for PCBs.
  • 22 double terminal blocks for PCBs
  • One 9pin female DSub connector for PCBs.
  • One PCB or a Veroboard (PCB layout is included).
  • In case of a Veroboard, wire for the connections
  • Solder and a soldering iron.

You will also need two mercury switches for shock sensors


In the following pitcure you can see the schematic diagram of the controller (Click on the picture to enlarge).

Notes: {write some notes here. Don't forget to write for the pulldown resistors}
PCB layout

(upload PCB)
Downloading the firmware to ATTiny2313

In order the game machine controller to work, you need to download the firmware to ATTiny2313. You need to do this only once.
Of course you will need a programmer to download the code. You can use whatever programmer you like (e.g. STK500), that is supporting AVR microcontrollers,. If you don't have such a programmer, you can buy one or you can build one by yourselves.
I recommend the simple SI-Prog programmer presented in this site. It's very easy to build and it has low total cost (close to zero if you already have the necessary components). You will also need to download and install PonyProg2000 from the aythor's website (www.lancos.com/ppwin95.html).

Here I will describe the downloading procedure in few steps, supposing you have built the simple SI-Prog.

Step 1: First download the hex file of the code (firmware). AVRKBD_firmware.zip

Step 2: After unzipping the file, open PonyProg2000

Step 3: From menu select "Device" "AVR micro" "ATtiny2313"

Step 4: Remove ATTiny2313 from BASAVRa LiTe and place it on the programmer. Then connect the programmer to your computer's serial port. Power on the device. From menu select "setup" "Interface setup..." and the I/O port setup window will pop-up.

Select the serial port you connect the programmer (usually COM1). From the dropdown list select "JDM API" or "SI-Prog API". The window must look like the above picture.

Attention: SI-Prog and PonyProg2000 require a physical serial port on your computer. IT WILL NOT WORK with a USB to Serial converter.

Step 5: Select "Command" "Security and Configuration bits..." and the Security and configuration bits window will pop-up, after automatically reading the device. Uncheck all the boxes like you see in the picture below. Press the button "Write". Then Press "OK"

Step 6:
Now we are ready to load the hex file. Select "File" "Open Device File...". Browse to the directory you unzipped the hex file and press "Open"


Step 7: Now we are going to program the chip. Select  "Command" "Write All" and press yes to the pop-up message. Now you will see the programming procedure initialized. First the program will write the code and then will automatically verify it.

Step 8: If you see the write successful notice, then the procedure has been completed. Now, the firmware has been downloaded and your chip is ready to go. You don't have to repeat these 8 steps anymore.

Note: If you have a write error message please try again. Make sure you have powered the device on during the whole procedure.


Source Code

The Game Machine controller is Open Source under GPL and you can download the code from the following link: AVRKBD.zip
The code is written with avr-gcc.

Keyboard Controller

In order to use this circuit you need the appropriate software which is running to the PC and communicates with the microcontroller.
The appropriate software has been added to HTMLFrontEnd version 5.0a and above. It is the executable file with the name kbrdController.exe

In order HTMLFrontEnd to load the keyboard controller software (the kbrdController.exe) aytomatically you need to change the setting LoadKeyboardController in the settings.ini file from no to yes
Also you need to provide the serial port of the computer with which the game machine controller is connected to (If your computer doesn't have a physical serial port you can yse a USB to Serial cable). In order to do that simply time the port's name to the Controllercomport setting inside settings.ini.
For example:
Controllercomport = com1

Then you need to setup the keyboard stroke associations accordingly. You can see the supported keyboard strokes inside the settings.ini file of HTMLFrontEnd. The procedure is straightforward. Uou simple type the name of each button e.g. button1 equal to the keyboard association
button1 = LEFT
button2 = RIGHT
button5 = UP



In the following pictures you see the pcb with the electronic components allready soldered.

In the following picture you can see all the pull down resistors soldered to the back of the PCB


Home | Articles | Projects | Downloads | About
Copyright 1997 - 2009 Dimitris Piperidis. All rights reserved