EE 552 Student Application Notes
Atari ST Controller
By
Tetris Group
KhernYang Twang
Feng Gui
Taozhi Peng

Introduction

This application note describes the use of an Atari ST controller using standard DB9 port. The Atari controller can be used for any program that requires four directional and a single fire button controls.
 

Design

In the following diagram is the connector pin layout for the Atari ST controller.

Connector: Female DB9

     5 4 3 2 1

       9 8 7 6
 
Pin
Description
1
Joystick 0 (up)
2
Joystick 1 (down)
3
Joystick 2 (left)
4
Joystick 3 (right)
5
Not Used
6
Button 1 (fire)
7
Not Used
8
Ground
9
Not Used

To get the Atari controller to work with the Altera UP1 board, the controller has to produce a logic '0' (0V) when pressed and logic '1' (5V) when not pressed. As seen from the pin layout, the controller does not have a Vcc input, therefore it cannot produce logic '1'. A external circuit has to be built so that the controller can produce logic '1'. An example of the Atari controller internal circuit is shown below:

Gnd (Pin8)        Joystick 0 (up)                Pin 1
    o--------------------- \-----------------o (to UP1 board)

From the diagram, we realize that we have to built another external to produce +5V for logic '1' to the UP1 board. The external circuit is to produce +5V at pin 1 when the internal circuit is opened. And produce 0V when the internal is shorted. A huge resistor is need to drain most of the voltage when the internal circuit is shorted to produce 0V. The whole circuit is given below.

Gnd (Pin8)        Joystick 0 (up)                 Pin 1            5.6K Ohm        Vcc
    o--------------------- \-----------------o--------------/\/\/\-----------o

When the joystick 0 switch is closed, pin 1 is ground therefore produces logic '0' (0V). When the joystick 0 is opened, pin 1 produces logic '1' (5V) due to the open circuit. The rest of the pins are connected to their own external circuit except the Gnd pin and to the UP1 FLEX_EXPAN_A connectors. The following table is the pin assignments on the FLEX_EXPAN_A:
 
Pin
Hole Number
FLEX_EXPAN_A Pin Assignment
1
15
45
2
17
48
3
19
50
4
21
53
6
23
55
8
4/6
GND

This application only applies to Atari ST controller. If there is other DB9 controller, refer to http://www.phm.lu/documentation/connectors/Control%20DB9.asp for the DB9 pin layout .

Test Program

A VHDL code is written to test the controller.

The outputs from the code are display on FLEX_DIGIT to valid the test. We assign the output as followed:

Please refer to figure 4 on page 9 in the UP1 documentation for the LED segment layout.
 
Output Name
LED segment
FLEX_DIGIT Pin Assignment
o_up
a
6
o_down
g
13
o_left
b
7
o_right
f
12
o_button
Decimal Point
14

A potential problem with all controller is the deboucing on the button. During testing, the debounce of the controller doesn't exceed 20% of the value change. This will not create problems when using the controller.

Contact Us

If you have any enquires, please contact Khern at twister@v-wave.com .