Connector: Female DB9
5 4 3 2 1
9 8 7 6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 .
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.