ENGLISH 简体中文 日本語 한국어  


애플리케이션 노트  827

PC Serial Port Drives 12-Bit A/D Converter

Abstract: This application note provides an example of interfacing an A/D converter to a PC using a standard serial port. The CS lines and SCLK lines are emulated by the RTS and DTR lines respectively. Conversion data appears on the data-set-ready (DSR) line. Example C code is given to demostrate the application circuit.

The circuit shown in Figure 1 performs a task usually carried out by a microcontroller—that of driving a 12-bit A/D converter (ADC) from the serial port of a PC. Power consumption is low: The 2mA operating current drops to only 15µA in shutdown.

Figure 1. This 
micropower circuit enables a PC's RS-232 serial port to control a 12-bit A/D converter (IC3).
Figure 1. This micropower circuit enables a PC's RS-232 serial port to control a 12-bit A/D converter (IC3).

Interface to the PC is an RS-232 port rather than the transmitter/receiver lines of a UART. The port's request-to-send (RTS) line provides a chip-select signal, and its data-terminal-ready (DTR) line provides a synchronous-clock signal. A single-supply RS-232 interface chip (IC1) converts these signals from RS-232 levels to CMOS-logic levels (and inverts them in the process). Conversion data appears on the data-set-ready (DSR) line.

IC3 is an 8-pin DIP that includes a 12-bit ADC, voltage reference, track/hold, serial interface, and clock generator, plus a 3-wire digital interface consisting of chip select (active-low CS), serial clock (SCLK), and data out (DOUT). Conversions are initiated by a high-to-low transition on active-low CS and take less than 8.5µs. The end of conversion, indicated by a high level on DOUT, leaves the 12-bit result stored in the converter's output shift register. The PC reads this result by clocking DTR while sampling DSR 12 times.

As a low-power version of the venerable (10mA) MAX232, the MAX220 draws only 0.5mA. If power is not a concern, either device is suitable for level-shifting the converter's SCLK, DOUT, and active-low CS signals to RS-232 levels. Power is supplied by a 9V battery via the linear regulator (IC2), whose output capacity is 40mA. This circuit draws only 2mA, 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 C3 allows Q1 to remain on during DTR's brief negative clock pulses. When DTR goes low for more than 100ms, C3 discharges and turns Q1 off, allowing IC2 to enter shutdown. For that condition, the circuit's supply current is essentially that of IC2—15µA maximum and 5µA typical.

The circuit is controlled by a simple C routine on the PC (download EJ22 Listing ZIP file). The code drives DTR high to wake the converter and then starts a conversion, waits for completion, clocks out the data, displays the data, and puts the circuit back to sleep. You can then quit by pressing "Q" or trigger another conversion by pressing any key. The software is easily modified for particular applications.

Figure 2. Timing relationships for Figure 1.
Figure 2. Timing relationships for Figure 1.


의견을 보내주세요!
위 내용이 도움이 되셨나요?
여러분의 의견을 기다립니다 — Maxim은 보내주신 정정이나 제안사항을 반영하고 있습니다. 이 페이지를 평가하고 의견을 보내주십시오.


자동 업데이트
관심있는 분야의 애플리케이션 노트가 나올 때 자동으로 업데이트 받고 싶으세요? 그렇다면 EE-Mail™을 신청하십시오.



추가 정보  APP 827: Jul 01, 2001
MAX187 +5V, 저전력, 12비트 직렬 ADC 전체 데이터 시트
(PDF, 192kB)
무료 샘플
MAX220 +5V 전원 공급, 멀티채널 RS-232 드라이버/수신기 전체 데이터 시트
(PDF, 360kB)
MAX666 듀얼 Mode™ 5V 프로그래밍 가능한 마이크로파워 전압 레귤레이터 전체 데이터 시트
(PDF, 376kB)
무료 샘플
 

다운로드, PDF 형식다운로드, PDF 형식 (37kB)
 AN827, AN 827, APP827, Appnote827, Appnote 827



         


      개인정보보호 정책    법적 고지

      Copyright © 2008 by Maxim Integrated Products, Dallas Semiconductor