computer mrie~.18
edited by JOHN W. MOORE Eastern Michigan University, Ypsilanti. MI 48197
Interfacing Microcomputers A Brief Guide for the Scientific User of S-100, TRS-80, PET, and Apple Microcomputers Kenneth L. Ratzlaff' The Michael Faraday Laboratories, Northern Illinois University, DeKalb. IL 601 15
The recent microcomputer (/LC)revolution has brought powerful computing machines into the office, lab, classroom, and home. These machines can fill needs of chemists and other scientists in two eeneral wavs: . (1) . . the uC mav he used for computation, partially replacing a large, time-shared computer by trading speed for availability, or (2) it may open up new applications that take advantage of its ability to respond to the real world on the microsecond time scale ( 1 , 2 ) . The former application is now commonplace; the fiC is used in computer-assisted instruction (3)and even in medium-scale computation. However, the latter application will have the greater scientific impact once the details of transferring data to and from real-world devices are commonly understood. The following is a guide to interfacing gCs to real-world devices. It is necessarily simplistic, assuming only a hare understanding of digital logic and analog electronics; further understanding of T T L can he gained using available tutorials (4-6). Before continuing, several conventions must he established. First the digital logic discussions will be based on the protocol of Transistor-Transistor Logic (TTL). Second, a binary "0" will he assumed equivalent to a T T L "LO," and a binary "1" will he eauivalent to a TTL "HI." Finallv. .. when dealing with compute;addresses and data, hase 2 (binary), hase 8 (octal), hase 16 (hexadecimal) numherine.. svstems are more useful . c h : . ~I~m e 10 I& t.imal,. I n {wdert . di.tinguish ~ these syste~n have be, # m eavailhle a hich include the TRI-STATE buffcrsand part of the DSP logicon the integrated cirruit. A l t l ~ o u ~many h arc only 8-hit ronverters, a 1 2 - b ~example t is thr Analog Dvvivt,sAD571. These types of improvemrnt%dramala ally decrciit the effort in building an interface. ADC's are not the only input devices that can be accessed by acomputer's input port. Some examples of single bit digital
categories. Most types of chemical instrumentation transduce chemical information to the electrical domain (5).Computers can. using ADC's. readilv acauire ootentiometric information (15). lighi intensities ( 7 , 8 , 1 i , 12);mass ( l l ) , temperature (2) and nearly any other experimental output encountered in the laboratory. Encoders can he used to produce digitally encoded position measurements (2. 12) without the need for an ADC. Binary conditions are also often converted to T T L levels as shown in Figure 9. Examples include limit switches (12) on wavelength drives or panel switches toggled by the operator. The wide range of parameters controlled or measured through input or output ports make possible real-time closed-loop control of parameters. For example photomultiplier gain is controlled by measuring the photocurrent during a reference cycle on a spectrophotometer and modifying the gain voltage accordingly. Power Supplies
The 5-100 bus was designed to provide the power to drive interfaces. The voltages required for an analog 110 interface would be f 15 V for the converters and operational amplifiers, and +5 V for T T L logic. These voltages can be derived from the f I8 V and +8 V available on the bus. The simple three-pin regulator circuits for this purpose are shown in Figure 10. The Apple provides limited capacity, regulated power on its bus, but external power supplies must be provided for interfaces for the P E T and TRS-80. Figure l o . P o w e r Supply Circuits for t h e S - 1 0 0 Bus. (a)+ 1 5 +5 V: (d) Pinout of a 6 p i n regulator.
V: ( b ) -15 V: ( c )
inputs are seen in Figure 9. In Figure 9a, a sense switch produces a "0"when closed: when oDen the 5 V is the i n ~ u tSense . switches may be panel switches or micro switchers used to detect position. In Figure 9b, a phototransistor is monitored to detect the binary presence or absence of light; an operational amplifier buffers the signal and a 7414 Schmitt trigger shapes and cleans the signal in order to match it to T T L levels. In an optical interrupter such as GE H13B1, a light emitting diode and a phototransistor are mounted in a single plastic package with a small gap; this can be used to detect whether an object is in a particular position where it would block the beam. The circuit in Figure 9c illustrates the use of a comparator to compare a signal with a preset threshold value. The Analog Devices AD590 temnerature transducer is a constant current regulator with a temperature coefficient of 1 pAIoK. Operational amulifier U1 converts this to a voltace. 50 mVPC. If the 1 0 0 0 and ~ 0 V for T > 100°C. Applications
Acquisition of experimental information also falls into two
Conclusions
It is hard to imaaine experimental Darameters that cannot he converted to and from digital vaiues. Inexpensive computers make real-time control of experiments through relatively simple interfaces. Literature Cited (11 RaCzlafi, K. L., Amrr. L a b . 10(21. 17 (19731. (21 Ratzlaff, K. L.. "Concept8. Approsehes. and Capabilities of Laboratory Computers," in "The Laboratury Computn Coursebaok and Crtelw". ACS Chicago Section, Chicago. 1931. (31 Lover. S.. Gerhold. G.,Smith, S. G.. Johnson,K. J.,andMoore, J. W.,.I.CHEM. EDUC.. I.219 (19791; Gerhoid. C.. Macero. D. J., Lyndrup, M.. and Moure, J. W.. J . CHEM. EDUC.,56,7UI !1979);Moure,d.,Corhold,C.,Brenemhn,G.L.. 0wm.G. S..Bufler. W., Smith, S. G., and Lyndrup, M.L.. .I. CHEM. EDUC.. 56,776 (1979): Maore. J. W.. Gerhu1d.C.. Rishop. R. D.Ge1der.J. I.,Pollnox, G.F..andOron, G. S.. J. CHEM. G.".,.. C" "" ,,on,,? u..""., "., \.""",. (4 Lamen, D., and Rony. P., "Logic and Memory Experiments Using l T I . IC'P," Vnls.
1and 11, Howard W. Sama, 1974. (51 Mdmstadt. H. V., Enhe. C. C.. Crouch, S. R.. ~'ElertronieMearurements lor Scientists,ii W. A. Renlamin. MmloPaik.CA. 1973. 161 Diefendefier, A. .I., "PrinciplesoiElpctronic Instrumentation."2nd~.,W.B.Saunders, Phiiadelphin. 1979. 171 Retziaff,K. L. and Damr, H.,Anol. Chem.51.2SS (19791. (81 Rsnue. R. W., Gregory, R. P., Auery. J., and Malmstadt. H. V., Clin Chrm.. 20, 966
~.".
,,a,*, .,.
(91 Lundbeie. E..and Johansron. G.. A m 1 Chsm.43.1922 11973). (101 F e l k e 1 , ~ ~ L and . Pardue, H. L.,Anai. Chem .49, 1112 (19771. I111 Renoe.B. W., O'Keele, K. R.,MalmrUldt. H. V., Anal Chrm.48.661 (197fi). (121 Spillman,R. W. and Malmstsdt, H. V., Anal. Chem., 43, :a03 (19761. 1121 Sheingold. D. H.,"Analog~Digild Notes? Analog Devices. Norrood, MA, 1975. (141 Zuch. E. I., "Data Acquisition and Conversion Handhnk: Drtel Systems. Mansfleld, M A ,om
(151 Engh,Sfeve andRatziaff, K. I... J. CHxM. EDUC.,57,815 (19301
Volume 58
Number 6
June 1981
475