設(shè)計者通常使用0-20mA和0-10v隔離輸入作為工業(yè)應(yīng)用控制的信號。利用獨立電源的組合,隔離的電源、嵌入的隔離Analog Devices公司的AD7400 Σ-Δ調(diào)節(jié)器,和Texas Instruments公司MSP430微處理器結(jié)合創(chuàng)造一個工業(yè)設(shè)計師需求的完整的、隔離的、穩(wěn)定的模擬信號接口的設(shè)計方案。一個高精度信號調(diào)理電路產(chǎn)生AD7400需求的微弱差分電壓(圖1)。電路產(chǎn)生所需的200mV差分電壓。為明確起見,圖中省略了過壓二極管和保護(hù)電路。
通過適當(dāng)規(guī)模的電阻R2,0-20mA電流回路轉(zhuǎn)化為電壓,然后進(jìn)入精密運算放大器。信號連接到負(fù)輸入端,通過在放大器正輸入端維持一個恒定電壓,獲得正向偏置。而0-10v的信號,例如來自一個電位器,規(guī)模與0-20mA電流信號時的電壓規(guī)模相似,并且合計到Analog Devices公司OP1177放大器IC1的負(fù)端口。
平移信號到0V以上,導(dǎo)致信號類似于一個正單向模擬信號。差分ADC驅(qū)動放大器Analog Decives公司的AD8138驅(qū)動AD7400。這樣的合成信號增益等級為ADC需求的±200mV。最后,在連接到AD7
400之前,信號通過一個低通濾波器,其中R10、R11和 C4放于正向和負(fù)向端口之間。AD7400轉(zhuǎn)換差分信號,使用低成本微處理器處理。Σ-ΔADC調(diào)解器,例如AD7400,常用連接到FPGA或DSP。不過,這種做法在成本和復(fù)雜性上要付出很高代價。對成本敏感的應(yīng)用不需要進(jìn)一步的濾波器,可以使用簡單的微處理器。
AD7400有兩個輸出,MCLKOUT和MDAT(圖2)。MCLKOUT,一個10MHz的時鐘,與被調(diào)制的數(shù)據(jù)流MDAT同步。AD7400定義MDAT為占一段時間的百分比。由于MDAT只在MCLKOUT的上升沿發(fā)生變化,電路必須一起同步MCLKOUT和MDAT信號,產(chǎn)生微處理器可以計數(shù)的脈沖信號流。微處理器首先反轉(zhuǎn)MCLKOUT,來防止MDAT轉(zhuǎn)換邊緣處產(chǎn)生毛刺而被計數(shù)。圖中顯示了MDAT,反轉(zhuǎn)MCLKOUT以及由此產(chǎn)生的數(shù)據(jù)流。
脈沖調(diào)制的數(shù)據(jù)信號和反轉(zhuǎn)的MCLKOUT信號都分別連接到位于微處理器上的定時器/計數(shù)器(圖3)。 TI的MSP430F2274提供了兩個16位計數(shù)器,并能夠支持最高16MHz的運行速度。當(dāng)時鐘計數(shù)器發(fā)出一個溢出中斷信號時,通過采樣數(shù)據(jù)計數(shù)器,電路測量ADC的轉(zhuǎn)換值。這樣,在循環(huán)緩沖中運行平均數(shù)量的測量數(shù)據(jù)可方便地對數(shù)據(jù)濾波。
英文原文:
Build a complete industrial-ADC interface using a microcontroller and a sigma-delta modulator
Handling both 0 to 10V and 0- to 20-mA inputs, this circuit digitizes the inputs and feeds a low-cost microcontroller.
Patrick Weber and Craig Windish, Siemens Energy and Automation, Pittsburgh, PA; Edited by Charles H Small and Fran Granville -- EDN, 7/5/2007
Designers commonly use 0- to 20-mA, 0 to 10V isolated inputs for industrial-application-control signals. A combination of isolated supplies, the built-in isolation of an Analog Devices AD7400 sigma-delta modulator, and a Texas Instruments MSP430 microcontroller creates a design for industrial designers requiring complete, isolated, and robust analog-signal interfaces. A precise signal-conditioning circuit generates the small differential voltage that the AD7400 requires (Figure 1). The circuit generates the required 200-mV differential voltage. For clarity, the figure omits overvoltage diodes and protection circuits.
A 0- to 20-mA current loop converts to a voltage through a properly scaled resistor, R2, and enters a precision operational amplifier. The signal level, which connects to the negative input, gets a positive offset by maintaining constant voltage on the positive input of the amplifier. The 0 to 10V signal, such as that from a potentiometer, also scales to a similar voltage to that of the 0- to 20-mA signal and gets summed into the negative termi
nal of the Analog Devices OP1177 amplifier, IC1.
Shifting the signal above 0V results in a signal that is similar to a positive, single-ended analog signal. A differential ADC-driver amplifier, Analog Devices’ AD8138, drives the AD7400. The gain scales such that the resultant signal is within ±200 mV, which the ADC requires. Finally, before connecting to the AD7400, the signal runs through a lowpass filter, which R10, R11, and C4 create between the positive and the negative terminals. The AD7400 converts this differential signal and processes it using a low-cost microcontroller. Sigma-delta-modulator ADCs, such as the AD7400, commonly interface to an FPGA or a DSP. However, this approach comes at a high price in both cost and complexity. For cost-sensitive applications not requiring advanced filtering, you can use a simple microcontroller.
The AD7400 device has two outputs, MCLKOUT and MDAT (Figure 2). MCLKOUT, a 10-MHz clock, synchronizes the modulated data stream, MDAT. The AD7400 interprets MDAT as a percentage of ones over time. Because MDAT changes only at the rising edge of MCLKOUT, the circuit must AND together MDAT and MCLKOUT to create a stream of pulses that the microcontroller can count. The microcontroller first inverts MCLKOUT to prevent unintentional glitches from being counted at the transition edges of MDAT. The figure shows MDAT, inverted MCLKOUT, and the resulting data stream.
The pulsed data signal and the inverted MCLKOUT each feed into a separate timer/counter on the microcontroller (Figure 3). The TI MSP430F2274 provides two 16-bit counters and can support operation as fast as 16 MHz. The circuit measures the ADC value by sampling the data counter when the clock counter signals an overflow interrupt. For this application, running an average number of data measurements on a circular buffer may conveniently filter the data.