You are here

Scientific Applications of the Apple Game Port


Kenneth Ratzlaff

Note: This article was scanned using OCR from the 1984 Summer CCCE Newsletter. Please contact us if you identify any OCR errors.
Part I. The Basis of the Measurement
Understanding the fundamentals of data acquisition and control is an important part of learning about the use of small computers in chemistry. Data acquisition typically involves an analog-to-digital converter subsystem to digitize voltage levels, the typical output of scientific apparatus. Although sometimes different analog levels are provided as output for control, control usually involves simply turning some device on or off or delivering a pulse.
In a series of articles in this Newsletter, I would like to indicate how data acquisition and control can be taught at moderate equipment costs using game ports. Alternatively, analog-to-digital converter subsystems and parallel port boards could be used but this would typically add $500 to the cost of each computer system. Such additional costs are justifiable when a particularly important interface problem demands it, but the principles of data acquisition and control can be adequately taught using the game port. In this article, I will introduce the components of the game port. In the next issue, I want to gather together some of those applications that have been made. In a final article, I will introduce some experiments which introduce the fundamentals of data acquisition.
The Apple II Game Port
The Apple game port is accessed by a DIP connector on the main board of the computer. The socket is an ordinary integrated circuit socket, so you need a cable which is terminated with a DIP connector, available from Radio Shack and many hobbiest mail order concerns. The pins of this socket are defined as follows:
1 +5 volts                        7 Potentiometer 2           12 Annunciator 3
2 Push button 0               8 GROUND                       13 Annunciator 2
3 Push button 1               9                                      14 Annunciator 1
4 Push button 2             10 Potentiometer 1           15 Annunciator 0
5 STROBE*                      11 Potentiometer 3           16
6 Potentiometer 0
The +5 volt pin can supply up to 100 rna to your external device to light lamps or LEOs, etc.
The two pushbutton inputs are simple standard TTL inputs which are used in two typical ways. First, they were designed to detect a switch closure; if an ordinary mechanical switch is connected between the input and ground, the input will read a logical 0 when the switch is closed (the input is shorted to ground) and a logical 1 when the switch is open. If the device under study has a TTL-compatible output, connection of it directly to this input is possible.
The status of a pushbutton input is determined by programming. (In BASIC a function PEEK (49249) or PEEK (4925.0) provides information on the status of push button 0 anrl l, respectively.
The four annunciator outputs are TTL outputs which can be used to deliver pulses or logical conditions to other TTL circuits, for example, to start various operations. Also, they can be used to control mechanical or solid-state relays, turn on power transistors, and in general turn almost anything on and off (except maybe back-row freshmen) .
The annunciator outputs are turned on and off by writing statements which will access their a4dresses; the access may be either to READ (PEEK) from the port or to WRITE (POKE) to a port .. For Annunoiator 0, the statement I = PEEK(42940) will turn the-output off; the statement I = PEEK(42941) will turn it back ON. For Annunciators. 1-3, the corresponding address pairs are 49242/49243, 49244/49245, and 49246/49247.
The potentiometer input is a very special type of analog-to-digital converter input. Its operation is controlled by the computer, and we will not go into the method of conversion here since one method of using it is to use the POL. command in BASIC.
The result of a conversion is directly proportional to the resistance between the input and 5 volts. The maximum result (255) is delivered when that resistance is greater than or equal to 150 K n and the result will be zero when the resistance is zero. Therefore, the paddle input can be used as an ADC when the transducer (sensor) makes a large change in resistance.
The most obvious sensor is the paddle or a similar potentiometer. A single or multiturn pot can be used to sense angle or, with a pulley, linear position. Since linear position can be related to a lot of things (force, speed, flow-rate, pressure, weight, etc.) with mechanical converters, this input could be quite versatile.
There are also several solid-state transducers which make a great change in resistance with change in a physical phenomenon. These phenomena include temperature, light-level and pulse-width.
Part II, the Next Installment.
Before the next issue, I need to hear from persons who have developed an application or an idea for an application using the game port. Of course, Apple !Is are not the only computers with game ports; many of the same capabilities are in Commodore 64's, VIC's,Atari's, etc.
I will construct a "bits and pieces" section on the topic using the following information.:
Type of data acquired or device controlled; Hardware (including source where that is important); Circuit diagram where it is not obvious.
*Director, Instrumentation Design Laboratory
University of Kansas
Lawrence, KS 66045


07/10/84 to 07/14/84