1.超时时间是怎么设定的?你看是不是这样的,1*数据更新速率相对应的时钟数目/256KHZ,是这样的吗?比如我设置正常模式,数据采集是20sps,DRDY转换完时
钟是204850超时时间是不是1*204850/256。
A.采集热电偶,冷端是PT100,ADS1220初始化是我一次性配置完所有参数,然后切换通道读取通道数据. B.第一步测量热电偶的电压,配置和热电偶相关的,不配置关于PT100的,然后采集读取数据。第二步配置和PT100相关的,不配置和热电偶相关的,然后采集读取数据。通过两次的采集计算温度。
这两种采用哪种配置呀?看DEMO都糊涂了。TI 的DEMO和我前面说的都不一样,TI的DEMO为什么这样,有什么好处吗?
__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; __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.这里面的初始化参数,有一样的也有不一样的,我看了它的初始化糊涂了。希望大家给解释一下