Design Ideas: October 12, 1995
The circuit in Fig 1 performs a task that a microcontroller usually performs, that of driving a 12-bit ADC from the serial port of a PC. Power consumption is low; the 2-mA operating current drops to only 15 µA in shutdown.
The RS-232C port's control lines (rather than its Tx/Rx lines) form an interface to the PC. The request-to-send (RTS) line provides a chip-select signal, and the data-terminal-ready (DTR) line provides a synchronous clock signal. A single-supply RS-232C interface chip, IC1, converts these signals from RS-232C levels to CMOS logic levels and inverts them in the process. Conversion data appear on the data-set-ready (DSR) line.
IC3 includes a 12-bit ADC, voltage reference, T/H amplifier, serial interface, and clock generator, plus a three-wire digital interface comprising chip-select (CS), serial clock (SCLK), and data out (DOUT). A high-to-low transition on CS initiates conversions, which take less than 8.5 µsec. At the end of a conversion, which a high level on DOUT indicates, the converter's output-shift register stores the 12-bit result. The PC reads this result by clocking DTR while sampling DSR 12 times.
A 9V battery and a linear regulator, IC2, whose output capacity is 40 mA, supply power. This circuit draws only 2 mA, so the extra capacity is available for powering an external sensor or amplifier. When DTR is high, Q1 turns on and allows the circuit to operate normally. Charge on C1 allows Q1 to remain on during DTR's brief negative clock pulses. When DTR goes low for more than 100 msec, C1 discharges and turns Q1 off, allowing IC2 to enter shutdown.
A simple C routine, which you can download from EDN FTP Site, controls the circuit. The code drives DTR high to wake the converter, starts a conversion, waits for completion, clocks out the data, displays the data, and puts the circuit back to sleep (Fig 1b). You can then quit by pressing "Q" or trigger another conversion by pressing any key. You can easily modify the software for your application. (DI#1768)