Hi,
I'm using a ADS1247 with a PT100 temperture probe in 3-wire configuration.
I'm using the suggested configuration in slau520a application note, but with some variation:
- Rref 1,2kohm (0.02% precision);
- Idac1 and Idac2 750uA;
- PGA 16;
With this configuration, I have a Vref of 1.8V (2 x Idac x Rref).
I configurated ADS1247 like follows:
- MUX0: 0x0A. AIN2 Negative input, AIN1 positive input, Burnout current source off (default);
- VBIAS: 0x00. Bias voltage not enabled (default)
- MUX1: 0x20. Normal Operation, REF0 input pair selected (default), Internal reference is always on, Internal oscillator in use.
- SYS0: 0x42. 20SPS, PGA 16.
- IDAC0: 0x05. 750uA, DOUT/DRDY pin functions only as Data Out (default)
- IDAC1: 0x30. I2DIR AIN0, I1DIR AIN3.
My source code for ADS1247 configure is the follow (START AND RESET PIN IS ALWAYS HIGH):
CS_ADS1=0;
while(DRDY_ADS1==1);
WriteSPI(0x16); // SDATAC
CS_ADS1=1;
__delay_ms(200);
CS_ADS1=0;
__delay_us(1);
WriteSPI(WREG);
WriteSPI(3); // write 3 register
WriteSPI(0xa); // mux0 register
WriteSPI(0); // vbias register
WriteSPI(0x20); //mux1 register //0x20
WriteSPI(0x42); //sys0 register
__delay_us(2);
CS_ADS1=1;
__delay_us(2);
CS_ADS1=0;
__delay_us(1);
WriteSPI(WREG|10);
WriteSPI(1); // write 2 register
WriteSPI(0x5); // idac0 register
WriteSPI(0x30); // idac1 register
__delay_us(2);
CS_ADS1=1;
__delay_ms(2);
CS_ADS1=0;
__delay_us(1);
WriteSPI(0x62); //self offset calibration
__delay_us(2);
CS_ADS1=1;
__delay_ms(100);
while(DRDY_ADS1);
CS_ADS1=0;
while(DRDY_ADS1==1);
WriteSPI(0x14); //Read data continuously
CS_ADS1=1;
__delay_ms(100);
For read the ADS1247 result my source code is:
CS_ADS1=0;
rtd_temperature=0;
ads_result=0;
while(DRDY_ADS1==1);
WriteSPI(NOP);
ads_result=ReadSPI();
rtd_temperature=ads_result;
rtd_temperature=rtd_temperature<<8;
WriteSPI(NOP);
ads_result=0;
ads_result=ReadSPI();
rtd_temperature=rtd_temperature|ads_result;
rtd_temperature=rtd_temperature<<8;
WriteSPI(NOP);
ads_result=0;
ads_result=ReadSPI();
rtd_temperature=rtd_temperature|ads_result;
__delay_us(2);
CS_ADS1=1;
Reading and writing on the registers is OK, and I have across Rref 1.8V
The problem is when I read the conversion result which is, according to me, wrong.
In fact at room temperature (25 °C) the ADC conversion result is 14090240.
If I use thw follow formula for RTD value calculate, I obtain:
RTD_VALUE = ADC_VALUE * Vref / PGA / (2^23-1) / EXCITATION_CURRENT= 14090240 * 1.8 / 16 / (2^23-1) / 0.00075= 251,95 Ohm
This value would translate to a temperature of about 414 °C.
Someone can help me?
Thank's for your help!
Best regards,
Michela