6607 views|5 replies

5

Posts

0

Resources
The OP
 

ads1220 [Copy link]

1. How is the timeout set? Is it like this? 1*the number of clocks corresponding to the data update rate/256KHZ? For example, if I set the normal mode, the data acquisition is 20sps, and the DRDY conversion time is 204850, is the timeout 1*204850/256? 31)]
2.[color=rgb(205, twenty three, 31)]ADS1220initializes in two situations:
A. Collecting thermocouples, the cold end is PT100,ADS1220initializes me to configure all parameters at once, and then switches channels to read channel data.
B. The first step is to measure the voltage of the thermocouple, configure the ones related to the thermocouple, do not configure the ones related to PT100, and then collect and read the data. The second step is to configure the ones related to PT100, do not configure the ones related to the thermocouple, and then collect and read the data. The temperature is calculated through two acquisitions.
Which configuration do these two use? I am confused after watching the DEMO. TI's DEMO is different from what I said before. Why is TI's DEMO like this? What are the benefits?
void main (void) { Setup_SPI_Master (); ADS1220_Reset(); Setup_ADS1220 (ADS1220_MUX_AIN3_AIN2, ADS1220_OP_MODE_NORMAL, ADS1220_CONVERSION_SINGLE_SHOT, ADS1220_DATA_RATE_20SPS, ADS1220_GAIN_32, ADS1220_USE_PGA, ADS1220_IDAC1_AIN3, ADS1220_IDAC2_DISABLED, ADS1220_IDAC_CURRENT_250_UA,ADS1220_VREF_EXT_REF0_PINS);
__delay_cycles(CPU_CLK/2);
while (1) { // Configure ADS1220 for first RTD measurement Setup_ADS1220 (ADS1220_MUX_AIN3_AIN2, ADS1220_OP_MODE_NORMAL,
ADS1220_CONVERSION_SINGLE_SHOT, ADS1220_DATA_RATE_20SPS, ADS1220_GAIN_32, ADS1220_USE_PGA,
ADS1220_IDAC1_AIN3, ADS1220_IDAC2_DISABLED, ADS1220_IDAC_CURRENT_250_UA,ADS1220_VREF_EXT_REF0_PINS);
__delay_cycles(CPU_CLK/1000);
ReadConversionData = 0;
ADS1220_Start ();
while (!ReadConversionData); // Wait for Data Ready interrupt
ADS1220_Get_RTD_Conversion_Data_Calibrated (&ADS1220RTDdata); // Get the temperature data with the calibration value subtracted
// Configure ADS1220 for second chopped RTD measurement
Setup_ADS1220 (ADS1220_MUX_AIN2_AIN3, ADS1220_OP_MODE_NORMAL,
ADS1220_CONVERSION_SINGLE_SHOT, ADS1220_DATA_RATE_20SPS, ADS1220_GAIN_32, ADS1220_USE_PGA,
ADS1220_IDAC1_AIN3, ADS1220_IDAC2_DISABLED, ADS1220_IDAC_CURRENT_250_UA,ADS1220_VREF_EXT_REF0_PINS);
RTDtemperature = ADS1220RTDdata;
__delay_cycles(CPU_CLK/1000); //
ReadConversionData = 0;
ADS1220_Start (); // Only one start needed for Continuous Mode
while (!ReadConversionData); // Wait for Data Ready interrupt
ADS1220_Get_RTD_Conversion_Data_Calibrated (&ADS1220RTDdata); // Get the temperature data with the calibration value subtracted
// Configure ADS1220 for first Thermocouple measurements
Setup_ADS1220 (ADS1220_MUX_AIN0_AIN1, ADS1220_OP_MODE_NORMAL,
ADS1220_CONVERSION_SINGLE_SHOT, ADS1220_DATA_RATE_20SPS, ADS1220_GAIN_32, ADS1220_USE_PGA,
ADS1220_IDAC1_AIN3, ADS1220_IDAC2_DISABLED, ADS1220_IDAC_CURRENT_250_UA,ADS1220_VREF_INTERNAL);
RTDtemperature += ADS1220RTDdata; //now averaging RTD results
RTDtemperature = RTDtemperature/2;
RTDtemperature = interpolateRTDTemperatureValue (RTDtemperature); // Get the RTD temperature and convert into millidegrees C
//cold junction compensation
CJCcode = calc_CJC(RTDtemperature); // convert RTD temperature into thermocouple voltage
__delay_cycles(CPU_CLK/1000); //
ReadConversionData = 0;
ADS1220_Start ();
while (!ReadConversionData); // Wait for Data Ready interrupt
ADS1220_Get_TC_Conversion_Data_Calibrated (&ADS1220TCdata); // Get the temperature data with the calibration value subtracted
TCtemperature = ADS1220TCdata/2;

// Configure ADS1220 for second chopped Thermocouple measurements
Setup_ADS1220 (ADS1220_MUX_AIN1_AIN0, ADS1220_OP_MODE_NORMAL,
ADS1220_CONVERSION_SINGLE_SHOT, ADS1220_DATA_RATE_20SPS, ADS1220_GAIN_32, ADS1220_USE_PGA,
ADS1220_IDAC1_AIN3, ADS1220_IDAC2_DISABLED, ADS1220_IDAC_CURRENT_250_UA,ADS1220_VREF_INTERNAL);
__delay_cycles(CPU_CLK/1000);
ReadConversionData = 0;
ADS1220_Start (); // Only one start needed for Continuous Mode
while (!ReadConversionData); // Wait for Data Ready interrupt
ADS1220_Get_TC_Conversion_Data_Calibrated (&ADS1220TCdata); // Get the temperature data with the calibration value subtracted
ADS1220TCdata = ADS1220TCdata/2;
TCtemperature -= ADS1220TCdata;
TCtemperature += CJCcode; //CJC
TCtemperature = interpolateTCTemperatureValue (TCtemperature); // Get the temperature and convert into millidegrees C
}
这是TI的DEMO 也是做热电偶采集,冷端补偿是PT100.这里面的初始化参数,有一样的也有不一样的,我看了它的初始化糊涂了。希望大家给解释一下
[cn/product/cn/ADS1220]ADS1220[/url]_Get_TC_Conversion_Data_Calibrated (&ADS1220TCdata); // Get the temperature data with the calibration value subtracted ADS1220TCdata = ADS1220TCdata/2; TCtemperature -= ADS1220TCdata; TCtemperature += CJCcode; //CJC TCtemperature = interpolateTCTemperatureValue (TCtemperature); // Get the temperature and convert into millidegrees C }
This is TI's DEMO, which also does thermocouple acquisition, and the cold end compensation is PT100. The initialization parameters here are the same and different. I was confused after reading its initialization. I hope you can explain it.
[cn/product/cn/ADS1220]ADS1220[/url]_Get_TC_Conversion_Data_Calibrated (&ADS1220TCdata); // Get the temperature data with the calibration value subtracted ADS1220TCdata = ADS1220TCdata/2; TCtemperature -= ADS1220TCdata; TCtemperature += CJCcode; //CJC TCtemperature = interpolateTCTemperatureValue (TCtemperature); // Get the temperature and convert into millidegrees C }
This is TI's DEMO, which also does thermocouple acquisition, and the cold end compensation is PT100. The initialization parameters here are the same and different. I was confused after reading its initialization. I hope you can explain it.

This post is from Analogue and Mixed Signal

Latest reply

For the second question, I downloaded the code you mentioned from the official website, but I still didn't understand it. The official code configured once before initialization and before entering the while loop. 1. ADS1220_MUX_AIN3_AIN2. The comment is // Configure ADS1220 for first measurement. Then configured RTD again. 2. ADS1220_MUX_AIN3_AIN2. The comment is Configure ADS1220 for first RTD measurement. After comparing, the two configurations are the same, so the first one should be omitted. Then start a conversion in the while loop, read the result of the last configuration conversion, and then configure RTD. 3. ADS1220_MUX_AIN2_AIN3. This time, AIN+ and AIN- are opposite to the last time. The last conversion result 2 is saved in RTDtemperature. Start the conversion of the third configuration of RTD. Read the result of the third configuration conversion. Configure TC. 4. ADS1220_MUX_AIN0_AIN1. Add the second result of RTD to the first result and divide it by 2. The comment is // now averaging RTD Results means to find the average, but if the input polarity of the two sampling results is opposite, the sum of the results should theoretically be zero I don’t quite understand this. Calculate the RTD temperature through the RTD result. Calculate the cold-end compensation code through the RTD temperature. Start the 4th configuration conversion. Read the 4th result. Divide the 4th result by 2. Configure TC 5. ADS1220_MUX_AIN1_AIN0 (opposite to the previous polarity). Start the conversion. Read the result after the 5th configuration conversion. Divide the 5th result by 2. Subtract the 2 results because the 2 results have opposite polarities. Dividing by 2 and then subtracting should give the average of the 2 results. Add the TC result and the cold-end compensation code. Get the TC (thermocouple) temperature value through the compensated TC result. Read the internal temperature sensor of ADS1220…………………………   Details Published on 2017-11-3 19:55

9721

Posts

24

Resources
2
 
I looked at the manual and found that when using the internal oscillator, fClk (ADC clock frequency) = 4.096MHz Normal and duty cycle modes fMOD (modulator clock frequency) = 4.096/16 = 256KHz SPI timeout Normal mode, duty cycle mode = 13955 fMOD Turbo mode = 27910 fMOD Taking normal and duty cycle modes as an example, fMOD is 256KHz, and the time corresponding to 1Hz is 3.9us 13955 fMOD = 3.9us*13955 = 54ms

This post is from Analogue and Mixed Signal
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

3

Posts

0

Resources
3
 
Cheer up for the OP
This post is from Analogue and Mixed Signal
 
 
 

9721

Posts

24

Resources
4
 
For the second question, I downloaded the code you mentioned from the official website, but I still didn't understand it. The official code configured once before initialization and before entering the while loop. 1. ADS1220_MUX_AIN3_AIN2. The comment is // Configure ADS1220 for first measurement. Then configured RTD again. 2. ADS1220_MUX_AIN3_AIN2. The comment is Configure ADS1220 for first RTD measurement. After comparing, the two configurations are the same, so the first one should be omitted. Then start a conversion in the while loop, read the result of the last configuration conversion, and then configure RTD. 3. ADS1220_MUX_AIN2_AIN3. This time, AIN+ and AIN- are opposite to the last time. The last conversion result 2 is saved in RTDtemperature. Start the conversion of the third configuration of RTD. Read the result of the third configuration conversion. Configure TC. 4. ADS1220_MUX_AIN0_AIN1. Add the second result of RTD to the first result and divide it by 2. The comment is // now averaging RTD Results means to find the average, but if the input polarity of the two sampling results is opposite, the sum of the results should theoretically be zero I don’t quite understand this. Calculate the RTD temperature through the RTD result. Calculate the cold-end compensation code through the RTD temperature. Start the 4th configuration conversion. Read the 4th result. Divide the 4th result by 2. Configure TC 5. ADS1220_MUX_AIN1_AIN0 (opposite to the previous polarity). Start the conversion. Read the result after the 5th configuration conversion. Divide the 5th result by 2. Subtract the 2 results because the 2 results have opposite polarities. Dividing by 2 and then subtracting should give the average of the 2 results. Add the TC result and the cold-end compensation code. Get the TC (thermocouple) temperature value through the compensated TC result. Read the internal temperature sensor of ADS1220…………………………
This post is from Analogue and Mixed Signal
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

5

Posts

0

Resources
5
 
Thank you, but the most important thing is the second question. I think my understanding of the first one is correct.
This post is from Analogue and Mixed Signal
 
 
 

5

Posts

0

Resources
6
 
By the way, I have a question for you. Is the fault detection of RTD generally done by hardware or software? I think it is done by software, but I don't know what the idea is for hardware. I hope someone who knows can explain it to me.
This post is from Analogue and Mixed Signal
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list