2012年9月16日 星期日

使用USB 界面做八通道資料擷取

8 CH Data acquisition system Using USB


The USB has become the interface of choice for connecting to PCs. Available on all relatively modern PCs, the USB offers a standard connector and can supply power to peripherals at 5V and as much as 100 mA of current. The circuit in Figure 1 combines Maxim's (www.maxim-ic.com) MAX1168, a low-power, 16-bit ADC, with a small USB-interface module to make a simple, eight-channel, 16-bit measurement system. The MAX1168 includes eight input channels, an SPI (serial-peripheral-interface) port, a 4.096V reference, and a clock oscillator. The MAX1168 operates from a 5V supply and can convert individual channels, execute multiple conversions on one channel, or scan the channels sequentially and store measured data on-chip.

Based on a Cypress (www.cypress.com) CY7C63743 controller, USBmicro's (www.usbmicro.com) U421 USB-interface module provides as many as 16 I/O lines and an option to use some of those lines as an SPI port at selectable clock rates of 62.5 kHz, 500 kHz, 1 MHz, or 2 MHz. Firmware on the U421 allows generic access to SPI read-and-write devices, and the device's general-purpose I/O lines can serve as slave-select lines for addressing multiple SPI devices. One I/O line controls the MAX1168's chip-select input. When you use it with an HID (human-interface device), the U421 USB controller can transfer data at rates as high as 800 bytes/sec. With additional filtering to reduce noise, the USB port provides 5V power to the circuit.

The MAX1168's sample-and-hold circuit must acquire the input voltage and charge its 45-pF holding capacitor in 3 µsec and thus requires a fast amplifier to minimize acquisition errors. Available in dual and quad versions, the MAX4230 provides a 10-MHz bandwidth, 2V/µsec slew rate, rail-to-rail inputs and outputs, and the ability to operate from a 5V rail or from voltages as low as 2.7V. The MAX4230's bias current—typically, 50 pA—allows significant input impedance without affecting accuracy.

To provide protection from overvoltages and apply input-voltage scaling, each buffer amplifier's input includes a 100-kΩprecision-matched resistive divider. This application uses Maxim's MAX5490VA10000 10-to-1 dividers, which provide a scaling factor of 1/11, to allow maximum readable inputs of 45V at resolutions of 687.5 µV.

Written in Microsoft's Visual Basic.Net, Standard Edition, the evaluation software provides commands to the U421 through the USBm.dll DLL (dynamic-linking-library) file. The demo program sets the MAX1168 to scan all eight channels and display the results. When you run the program, the Visual Basic form allows you to set the reference voltage to allow for the input divider, select the scan time, and enable any of the eight input channels for screen display (Figure 2). You can download the evaluation software at http://www.maxim-ic.com/products/data_converters/MAX1168_USB_DI.zip.

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。