|
|||||
October 23, 1997 Parallel port powers simple A/D interfaceDavid M Acre, McDonnell Douglas Aerospace, St Louis, MO If you have to sample just a few low-rate analog signals, or your PC's slots are all full or too outdated for the newer data-acquisition products, a simple interface may be all you need. You can build such an interface that requires no external power supplies or adapters (Figure 1). This design is an attractive alternative for applications that require low-rate, portable data acquisition. You can easily adapt the interface for use with a range of sensors, and you can easily create software modules for any application. The design comprises two ICs: a 2.5V micropower reference, IC1, accurate to ±1 mV and an eight-channel, 12-bit serial-interface A/D converter, IC2, that can sample at 133k samples/sec. The ultralow-power, eight-channel ADC obtains all its power from one parallel-port data pin. Both ICs together draw less than 2 mA at 5V. A bidirectional LED serves as a status indicator. One control-port pin and one status-port pin provide for self-test of the circuit. IC2 has a maximum input of 2.5V, and you can configure this ADC to measure either single-ended or bipolar voltages. The addition of a 10-to-1 probe circuit greatly extends measurement capability of the device. You can attach user-defined expansion modules to the channel interface for a variety of applications. Not all port pins are dedicated; you can route the unused data, status, and control pins to the probe connector to provide TTL-compatible inputs for logic-level triggering and monitoring or to provide TTL outputs for powering or signaling additional low-power interfaces. Because IC2 is a low-power device, you can power multiple devices from one or two data-port pins and individually select these devices, providing 16, 24, or even 32 inputs. Connector J1 attaches directly to the parallel-port through a short, male-to-male, 25-pin cable. J1-9 (data bit 7) supplies all of the power for IC1 and IC2. J1-3 (data bit 1) provides the clock to shift the data (most significant bit first) into and out of the ADC. J1-2 (data bit 0) supplies serial data into IC2's DIN pin. After the first 8 bits clock in--bits that select the mode of operation and the channel--J1-10 (status bit 6) monitors the end-of-conversion (STRB) pin until it returns to a high state. J1-12 reads the digitized data at IC2's DOUT pin (most significant bit first). The first 12 bits of data represent the binary value, and the next 4 bits are predefined to be zero. IC1 regulates 5V down to 2.5V±1 mV to accurately establish the reference voltage at Pin 11 of IC2. C1 provides a minimal amount of decoupling to clean the 2.5V reference. C2 provides all the decoupling necessary for IC2's VDD pins. Pin 10 (SHDN) of IC2 is left floating so that the device automatically uses its own internal 1.8-MHz clock to perform the A/D conversions. The 4.7-kohm pullup resistors inside the PC printer's control port power the bidirectional LED, so the brightness varies slightly from PC to PC. Setting both pins to zero effectively extinguishes the LED. You can set J1-16 (control bit 2) high and low to provide a changing voltage using R1, R2, and C3 on the test jumper. This feature allows you to use Channel 0 of IC2 for self-testing. You can remove the test jumper and use Channel 0 as a normal channel. J1-15 (status bit 3) monitors the test circuit node and provides a type of wraparound circuit to software-detect the presence of the adapter. IC2's input impedance is high, which causes channels 1 through 7 to "track" the test signal on Channel 0. The addition of the 10-to-1 probe circuit effectively cured this problem. The MAX147 data sheet predicts that the addition of the 100-kohm probe will modify the acquisition time to about 14-µsec. The higher the input impedance, the longer the capacitive ADC in the MAX147 takes to charge, which ultimately affects the accuracy. The access speed of the parallel port limits the maximum sample speed. Realistically, not even assembly-language programs can clock the port lines at the ADC's maximum sample rate, so a single-channel sample rate is substantially less than the ADC's advertised rate. The prototype can monitor all eight channels at 50 samples/sec on a 486-33 PC. This rate increases to 400 to 500 samples/sec for one channel. A specially tailored assembly language or C routine should be able to significantly increase the sample rate. Tests on three PCs indicate that even under a 2-mA load, the data-pin voltage that supplies power to the circuit never drops below 4.9V. The scaled decimal digital-data presentation is usable. The noise is about the equivalent of 28 LSBs (17 mV). Averaging reduces the noise by a factor equivalent to the square root of the number of averaged samples. Nine averaged samples reduce the noise from 17 to about 6 mV. A QBasic prototype program provides a fast, interpreted rapid-prototyping tool with an intuitive development interface. The program assumes a parallel-port address of 0378H for this example, but you can easily modify this address. Click here to download the file from DI-SIG, #2103. In the program, setting data-port bit 7 high applies power to IC2. To permit the most rapid data clocking to the ADC, a preloaded array contains the correct data patterns, which the PC clocks sequentially to data-port pins 2 and 3 (bits 0 and 1). The program scales the data that comes in on J1-12 (status bit 5) according to the least significant bit value (2.5V/4096=610 µV) and according to the 100- to 10-kohm divider to give a true voltage indication. The program then displays all eight channels. During a test of Channel 0, the channel reads exceptionally high levels because of the location of the test point. The program's use of the ON TIMER statement provides one-interrupt-per-sec background control of the activity LED by toggling J1-14 and J1-17. (DI #2103) |
|||||
|
|||||
| EDN Access | Feedback | Table of Contents | |
|||||
| Copyright © 1997 EDN Magazine, EDN Access. EDN is a registered trademark of Reed Properties Inc, used under license. EDN is published by Cahners Publishing Company, a unit of Reed Elsevier Inc. | |||||