Maxim Semiconductors makes a $5 ADC chip that provides signed 19 bit conversions. Although this is overkill for most laboratory applications, it is advantageous when monitoring data streams like Gas Chromatography that contain both large and small signals (large dynamic range.) Routine ADC devices are typically 12 bit-- for example the low cost serial converters by Dataq recommended by ________ for GC in a 200x J. Chem Educ article. To be effective, signals must remain within the full scale range of the converter; with a 12 bit converter the maximum signal is 4095 with a resolution of 1 part in 4000 or 0.025%. However a peak of 1/10 of that amplitude effectively has a resolution of 0.25% (1 part in 400) and a tiny peak (1/1000) has a resolution of only one part in 4. The situation improves significantly with more expensive 16 bit ADC's. Of course one can interrupt the signal by changing the attenuation or by using range switching amplifiers. A 19 bit ADC clearly has advantages here.
The Max132 uses three line Serial Interface to receive commands and to transmit data as 8 bit words. This is a synchronous serial device, meaning that one line (SCLK) provides the timing signal that separates data bits. (Standard computer ports are asynchronous serial ports, meaning that the bits are separated by controlled timing intervals.) Our goal is to use this chip on a standard computer serial port.
The simplest approach uses a technique known as "bit banging." A standard RS232 computer port contains two data lines (Receive and Transmit) but there are actually several additional input/output lines used for handshake protocols (e.g., "is this device ready to receive/send data?")
The RS232 port can be configured by setting one line to the first bit of a command. Then, another line can send a "1" to the SCLK terminal of the MAX132. When this SCLK line is returned to logical "0", one bit of data appears at the MAX132 TX terminal. This is connected to third status line and is read by the host computer. This is repeated eight times to transmit and receive one full word of data. (Five such cycles are actually required to request and receive one full data conversion.) One additional line is required to toggle the chips CS (chip select) line; it is preferable to use another line to monitor when a data conversion has been completed. This appears to be quite complex and cumbersome, but the task can be delegated to a small subprogram. One drawback is that the host computer must handle timing and must be able to invoke conversions at the correct time. This limits the range of tasks the host program is free to perform.
discussion of Bit Banging Methods and other low cost interface devices"
A more elegant solution is to use a low cost microcomputer/microcontroller to perform the more mundane tasks. We have chosen a PIC 16C774 that contains three essential components.
Link to a schematic (bit map); a copy appears at the bottom of this documetn
The schematic <fig> <link>shows the additional components
The primary limiting feature is the slow speed of data conversion. With the recommended crystal the MAX132 can perform a maximum of 16 conversions per second. We have standardized on 10 conversions per second which is quite adequate for our purposes. (Another crystal can achieve conversion rates up to 100 conversions per second, but with some loss of accuracy. Specifically, we lose the ability to synchronize with the 60 Hz power lines and thus a higher noise level is expected at other conversion rates.)
Our operating program (PIC) is minimal. The program continuously monitors its timer (T1) to determine when to perform the next conversion. It then checks the status of the RS232 RTS line to see if it should actually measure and report data. If requested, it sends the first data word to the ADC, initiating a conversion. The PIC then monitors the MAX132 EOC (end of conversion) line. When EOC goes high the PIC sends a sequence of four command words and extracts three data words. (Since data requested is available on the next cycle, the PIC needs four commends to provide three words of results.) When the third word is received the PIC repackages the bit as a standard 19 bit word and computes the twos complement if the sign but indicates a negative result. The 19 bit binary number is converted to a __ digit decimal number and this is transmitted along with sign and a <CR> to indicate end of the word.
We note that MAXIM provides quite detailed data sheets for the MAX132 along with examples of bit banging approaches using both serial and parallel data pots.
We designed this interface to use with older computers so the RS232 port is clearly available. We'd like to modify this to operate with a USB serial port; that is clearly more difficult. This is important with laptops and PDA units where a RS232 port might not be available. There are also increasing tendencies to remove RS232 from newer computer lines, shifting over to USB interfaces. There are several PIC units that have USB capability and we are examining ways to use them in this manner.