English
Language : 

CN-0300 Datasheet, PDF (4/7 Pages) Analog Devices – Complete Closed-Loop Precision Analog Microcontroller Thermocouple
Circuit Note
When calibrating the DAC, connect the VLOOP+ outputthrough
an accurate current meter.The first part of the DAC calibration
routine calibrates the DAC to set a 4 mA output, and the second
part of the DAC calibration routine calibrates the DAC to set a
20 mA output. The DAC code usedto set a 4 mA and 20 mA
output is stored to flash. The voltage measuredat AIN9 for the
final 4 mA and 20 mA settings is also recorded and saved to flash.
Because the voltage at AIN9 is linearly related to the current
flowing across RLOOP, these valuesare used to calculate the
adjustment factor for the DAC. This closed-loopscheme means
any linearity errors on the DAC and transistor based circuit are
fine-tuned out using the on-chip 24-bit Σ-Δ ADC.
The UART is configured for a baud rate of 9600, 8 data bits, no
parity, and no flow control. If the circuit is connected directly to
a PC, a communication port viewing application, such as
HyperTerminal, can be used to view the results sent by the
program to the UART, as shown in Figure 7.
To enter the charactersrequiredby the calibration routines,
type the required character in the viewing terminal and this
character will be received by the ADuCM360 UART port.
Figure 7. Output of HyperTerminal when Calibrating the DAC
Temperature Measurement Section of Code
To get a temperature reading, measure the temperature of the
thermocouple and the RTD. The RTD temperature is converted to
its equivalentthermocouple voltage via a look-uptable (see the ISE,
Inc., ITS-90 Table for Type T Thermocouple). These two voltages
are added together to give the absolute value atthe thermocouple.
First, the voltage measured between the two wiresof the
thermocouple (V1). The RTD voltage is measured, converted to
a temperature via a look-up table, andthen, this temperature is
converted to its equivalent thermocouple voltage (V2). V1 and
V2 are then added to give the overall thermocouple voltage, and
this is then converted to the final temperature measurement.
CN-0300
For the thermocouple, temperatures fora fixednumber of voltages
are storedin an array. Temperature valuesin between are calculated
using a linear interpolation between the adjacent points.
Figure 8 shows the error obtained when using ADC1 onthe
ADuCM360 to measure 52 thermocouple voltagesover the full
thermocouple operating range. The overall worst-case error is
less than 1°C.
0.5
0.4
0.3
0.2
0.1
0
–0.1
–0.2
–0.3
–0.4
–0.5
–210 –140 –70
0
70 140 210 280 350
TEMPERATURE (°C)
Figure 8. Error when Using Piecewise Linear Approximation Using
52 Calibration Points Measured by ADuCM360/ADuCM361
The RTD temperature is calculated using lookup tablesand is
implementedforthe RTD the same way asforthe thermocouple.
Note that the RTD has a different polynomial describing its
temperaturesas a function of resistance.
For details on linearization and maximizing the performance of
the RTD, refer to Application Note AN-0970, RTD Interfacing
and Linearization Using an ADuC706x Microcontroller.
Temperature-to-Current Output Section of Code
Once the final temperature hasbeenmeasured, setthe DAC output
voltage to the appropriate value thatgives the requiredcurrent
across RLOOP. The inputtemperature range is expected to be −200°C
to +350°C. The code sets the outputcurrent to 4 mA for −200°C
and 20 mAfor+350°C.The code implementsa closed-loopscheme,
as shown in Figure 9, where the feedback voltage on AIN9 is
measuredby ADC0, and this value is used to compensate the
DAC outputsetting. The FineTuneDAC(void) function performs
this correction.
For best results, calibrate the DAC before beginning performance
testing of this circuit.
Rev. A | Page 4 of 7