The ADuCM360_demo_cn0337 is a RTD temperature measurement demo project for the EVAL-ADICUP360 base board with additional EVAL-CN0337-PMDZ pmod, created using the GNU ARM Eclipse Plug-ins in Eclipse environment.
This project is a good example for how to use EVAL-ADICUP360 board in different combinations with pmod boards. It expand the list of possible applications that can be done with the base board.
The ADuCM360_demo_cn0337 project uses the EVAL-CN0337-PMDZ pmod which is a completely isolated 12-bits, 300 kSPS RTD temperature measuring system (with only three active devices) that processes the output of a Pt100 RTD and includes an innovative circuit for lead-wire compensation using a standard 3-wire connection.
The CN0337 circuit translates the RTD input resistance range (100 Ω - 212.05 Ω for a 0°C - 300°C temperature) into voltage levels compatible with the input range of the ADC (0 V - 2.5 V). The 12-bits ADC value is received via SPI interface of the EVAL-ADICUP360 board.
The EVAL-CN0337-PMDZ comes with an evaluation software which can help you to test and to calibrate your pmod before you use it with an RTD sensor.
The ADuCM360_demo_cn0337 application processes ADC output value and make all necessary conversions in order to provide RTD measure results. A UART interface (9600 baud rate and 8-bits data length) is used to send the results to terminal window: RTD temperature and resistance values, voltage calculation and ADC code. If the resistance and temperature values are out of range you get an error message which means that you need to check your settings.
The output values are displayed when you press ENTER key (CR) from the keyboard. Also you can decide how often the measurements take place (see SCAN_TIME parameter).
The project offers two method to calculate the RTD resistance, giving you the possibility to get more accurate RTD measurement results (see CN0337 circuit note).
You can use transfer function of the circuit which calculate RTD resistance based on voltage changed value and circuit gain:
Rrtd = (Vout - Voffset)/Gain
Or you can use the two-point calibration method which used the ADC output values for 2 different measurements: first using Rmin = 100 Ω (ADC1) precision resistor and second with Rmax = 212.05 Ω (ADC2) resistor.
Rrtd = Rmin + [(Rmax - Rmin)/(ADC2 - ADC1)]*(ADCrtd - ADC1)
Because the transfer function of the RTD (resistance vs. temperature) is nonlinear is needed a software linearization to eliminate the nonlinearity error of the RTD Pt100 sensor. This project used so called Piecewise Linear Approximation method.
This method characterized by taking linear approximation one step further, one can conceptualize any number of linear segments strung together to better approximate the nonlinear RTD transfer function. Generating this series of linear segments so that each segment’s endpoints meet those of neighboring segments results in what can be viewed as a number of points connected by straight lines.
These coefficients is calculated once to best match the RTD’s nonlinear transfer function and then stored permanently in a look-up table (see C_rtd table). From this table of coefficients, the software can perform simple linear interpolation to determine temperature based on measured RTD resistance.
The look-up table can have how many coefficients you needed depending how accurate you want to be. For this project the RTD resistance range is separated into 100 linearization segments.
The following is a list of items needed in order to replicate this demo.
There are two basic ways to program the ADICUP360 with the software for the CN0337.
Using the drag and drop method, the software is going to be a version that Analog Devices creates for testing and evaluation purposes. This is the EASIEST way to get started with the reference design.
Importing the project into CrossCore is going to allow you to change parameters and customize the software to fit your needs, but will be a bit more advanced and will require you to download the CrossCore toolchain.
The software for the ADuCM360_demo_cn0337 demo can be found here:
Prebuilt CN0337 Bin File
Complete CN0337 Source Files
For more information on importing, debugging, or other tools related questions, please see the tools user guide.
#define AD7091R_OPERATION_MODE POWER_DOWN
#define SCAN_TIME 500
#define VREF 2.5
#define RTD_FORMULA TRANSFER_FUNCTION
#define TMIN (0) /* Tmin [˚C] */ #define TMAX (300) /* Tmax [˚C] */ #define RMIN (100) /* Resistance [Ohms] at Tmin */ #define RMAX (212.052) /* Resistance [Ohms] at Tmax */ #define NSEG 100 /* Nr. of sections in look-up table */ #define RSEG 1.12052 /* Resistance of each segment */ #define ADC_MIN 152 /* ADC min for RMIN */ #define ADC_MAX 4095 /* ADC max for RMAX */
Following is the UART configuration.
Select COM Port Baud rate: 9600 Data: 8 bit Parity: none Stop: 1 bit Flow Control: none
The official tool we promote for use with the EVAL-ADICUP360 is CrossCore Embedded Studio. For more information on downloading the tools and a quick start guide on how to use the tool basics, please check out the Tools Overview page.
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to import existing projects into your workspace section.
For more detailed instructions on importing this application/demo example into the CrossCore Embedded Studios tools, please view our How to configure the debug session section.
The ADuCM360_demo_cn0337 project use ADuCM36x C/C++ Project structure.
This project contains: system initialization part - disabling watchdog, setting system clock, enabling clock for peripherals; port configuration for SPI0, UART via P0.1/P0.2; SPI, UART read/write functions; AD7091R control and RTD conversions.
In the src and include folders you will find the source and header files related to CN0337 software application. The Communication.c/h files contain SPI and UART specific data, meanwhile the AD7091R.c/h files contain the ADC control data and the CN0337.c/h files contain the RTD measurements management.
The RTE folder contains device and system related files:
End of Document