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).
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.
电子连接器老化测试作用
CR-AG24/1505蓄电池综合测试仪
浪涌抑制器的应用及注意事项?
图示均衡器的使用技巧
摩托罗拉Moto E7发布:Helio G25处理器
PC机串口驱动器12位A / D转换器-PC Serial
上海高研院等在单细胞红外成像技术的数据处理方法等研究中获进展
无线网络信号不好,如何快速提升WiFi信号
Hitachi Vantara扩展Hitachi VSP E系列,推出VSP E590和VSP E790
IGBT会用到哪些陶瓷基板?IGBT增长将拉动陶瓷基板需求?
全新荣耀智慧屏X1 75英寸上架京东正式开售
人工智能时代已到来,如何应对AI市场带来的机遇
五大厂商联手投资专注RISC-V生态的初创企业Quintauris
基于特征提取的快速扫描方法实现路面破损实时检测系统的设计
电脑主板的CMOS电路供电电路
VR成为了宗教体验的新宠儿
蚂蚁集团发公告:将积极对照和落实监管要求
生活愈方便的社会背景下的高科技时代的产物——大数据
应急物资管理系统|库房三维可视化
人工智能将会是这个时代最强大的力量