Interfacing the Commodore VIC-20 using joystick game ports - Journal

Interfacing the Commodore VIC-20 using joystick game ports. Harvey F. Blanck. J. Chem. Educ. , 1985, 62 (1), p 62. DOI: 10.1021/ed062p62.1. Publicatio...
0 downloads 0 Views 1MB Size
computer mrie~. 57

edited by

MOORE Eastern Michigan University, Yprilanti, MI 48197 JOHN W.

Bits and Pieces 22 Most authors of Bits and Pieces will make available listings and/or machine-readable versions of their programs. Please read each description carefully to determine compatibility with your own computing environment before requesting materials from any of the authors. Revised Guidelines for Authors of Bits and Pieces appeared in the December 1982 and December 1983 issues of the JOURNAL. Several programs described in this article and marked as such are available from Project SERAPHIM. If you do not already have a SERAPHIM Catalog, request one from: Dr. John W. Moore, Director, Project SERAPHIM, Department of Chemistry, Eastern Michigan University, Ypsilanti, MI 48197.

Interfacing the Commodore VIC-20 Using Joystick Game Ports Harvey F. Blanck Austin Peay State University Clarksville, TN 37044 In a recent article Hughes (1)briefly described interfacing using a TRS-80 joystick port which digitizes voltages using a six-hit analog to digital converter. While the Commodore VIC-20 game port does employ analog-to-digital conversion for paddle x and y inputs, the five joystick lines are ordinary hinary inputloutput lines connected internally to 6522 interface adapters. These 110 lines may be used in much the same way as the 110 lines available a t the Commodore 64, VIC-20 and PET Parallel User Ports. Since all User Ports have at least eight 110 lines, interfacing is often relatively easily accomolished (2. 3). Althoueh the User Port is the port of choice; the joy&k'lines proGide additional 110 capability if the User Port is alreadv in use. (The memorvex~ansion port . can also be used if needed.) As an example of interfacing using the VIC-20's joystick game port, an interface of an NLS PM-4501 4ll~digitpanel meter (DPM), which has four output lines for binary-coded decimal (BCD) representation of a digitized voltage and five lines to indicate which digit is being represented, will he described. Since the joystick port bas only five 110 lines, the BCD data and the digit indicator data cannot he read simultaneously. The digit indicator lines are used to enable chips to store the BCD data. Latched BCD data is then sent to the computer serially by connecting latch outputs to a 74150 multiplexer which has 16 input lines and one output line which is connected to a joystick line. The multiplexer output is selected by a 7493 counter which is controlled by two joystick lines. One ~ ~ - line ~ resets the counter. and the other line advances it. The remaining two joystick lines are used for the most simificant dieit which is either 0 or 1.and for the sim. A more complete description of t his ~nterlaceincluding circuit drsign and H samole VIC-20 Droernm is available from thr nuthnr. The techiques emdloyed can certainly he used to interface ~

,.

-

' Non-linear Systems, Solana Beach, CA 92075 Analog Devices. Norhood. MA 02062.

62

.lournal of Chemical Education

other devices. For example an analog-to-digital converter such as Analoa Devices AD574=12-bit ADIC can be controlled and read u s i G a 74150 and 7493 and four of the joystick lines (two to the counter, one to the converter. and one for data inout from the multiplexer). There are at ieast two problems with using these or similar interfaces. Leaving a joystick line unconnected may cause erratic behavior of the counter. Another prohlem is that the VIC-20 uses one of the joystick lines to read the keyboard. Use of this line may disable a portion of the keyboard. To regain control of the keyboard, the interface must be disconnected from the port if a "RUNISTOP-RESTORE" command is used, or a tristate buffer chiu under program control may be used to disconnect that p&ticular joystick line after using the interface. With some modification the techniques used for the VIC-20 could very likely be used to interface Commodore 64 and Atari microcomputers through their joystick ports. Use of Atari game ports would probably only involve changing the software since Atari microcomputers use 6520 interface adapters. The Commodore 64 uses all five joystick lines of both ports to read the keyboard and uses a 6526 interface adanter that is similar to the 6522. A grant from the Tower Club of Clarksville was useful and is appreciated.

Chromatographic Integrator forthe TRSIO James K. Hardy The University of Akron Akron, OH 44325 While eas chromatoarauhv is commonlv used in the teaching laboratory, one-ofthe most important instruments for data collection and intermetation, the electronic integrator, is not. Quite commoniy, the cost of this unit can be ~rohihitive.Even if an inteerator is available, its use mav not he desirable 3s the student [earns little ahout how it interprets data. A system has been developed that allows the student to see an integrator collecr and evaluate 93s chromatographic darn. It has I x m desipned ~ r i n c.i ~ a. lfor l v use in iuniorlsenior nnaly~icnlchwnistry Iat~oratories. The system cdlrcts dam using a data nquisition unit (IMU I) which consists of an R-bit annlng-twdigital converter that is designed to rransfer data to the computer via the HS-2:DC interfare.'l'hisallows for the useofrhe I)AU I with anvromputer equipped with this standard interface. Sampling rates of from 0.1 to 1000 samples/s and input ranges of from 0 to 0.01, 0.1, 1, and 10 V are possible. The integrator program, INTEGRAT. (written in BASIC) makes use of the ROM subroutines of the TRS-80 Model 111 for communication with the RS-232C and subsequently with the DAU I. ~

~~~

~~~~~

~~~~~

~

~.

Standardization The program initializes the DAU I, sets a sampling rate of 1s-' and reads the signal from the GC for 30 s. The variation of the baseline is then used as the minimum response for peak recoanition. The student is then asked for the analvsis time andinstructed to inject his sample. The data andtime are