This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LMP90098: Configuration for 3-Wire RTD Using 2 Current Sources reg.

Part Number: LMP90098
Other Parts Discussed in Thread: ADS124S08, ADS1248, LMP90100

Hi,

    I have integrated LMP90098 with the PT-100 RTD sensor and ADCout is given to MCU (STM33 controller with HAL API's) with SPI interface

    The initial configuration of LM90098:

void LMP90098_Init_Config(SPI_HandleTypeDef *hspi)

{

LMP90098_Write(hspi,0x01,0x08);                                                                                                     // argument 2- Register address; argument 3-Value 
LMP90098_Write(hspi,0x03,0x00);
LMP90098_Write(hspi,0x08,0x00);
LMP90098_Write(hspi,0x10,0x02);
LMP90098_Write(hspi,0x11,0x83);
LMP90098_Write(hspi,0x12,0x2A);
LMP90098_Write(hspi,0x13,0x00);
LMP90098_Write(hspi,0x17,0x01);
LMP90098_Write(hspi,0x20,0x41);
}

And ADC_OUT value Read is as follows,

uint32_t ADC_Read(SPI_HandleTypeDef *hspi)
{
uint8_t ADC_RxBuff[6]={0x10,0x01,0xCA,0x00,0x00,0x00};                                                                       // To read 3 bytes of data, starting from address 0x1A
uint32_t ADC_Out=0;
Val=LMP90098_Read(hspi,0x1E);  // Reading register 0x1E to Checking channel for scanning
if(Val>>1==0)
{
LMP90098_Write(hspi,0x1F,0x80);
LMP90098_Write(hspi,0x17,0x02);
if(DRDY_Flg)
{
DRDY_Flg = 0;
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_4,GPIO_PIN_RESET);                                        //asserting CSB

HAL_SPI_Receive(hspi,ADC_RxBuff,6,100);                                                                       //Reading ADC_DOUT

HAL_GPIO_WritePin(GPIOA,GPIO_PIN_4,GPIO_PIN_SET);                                             //Deasserting CSB


}

ADC_Out = ((ADC_RxBuff[5]) | ((ADC_RxBuff[4]<<8) | (ADC_RxBuff[3]<<16)));
return ADC_Out;
}
return 0;
}

Here is the schematics of AFE in our board:

  My queries are

1. If ADC_DOUT is 2 byte value then what will be the ADC_DOUTH will be filled with?

2. How can I improve ADC_DOUT accuracy?

3. Is it sufficient to monitor DRDYB signal to identify the new output in ADC_DOUT or should I even read the value in register 0x18.  

4. And for the same temperature the ADC_DOUT value fluctuating, what might be the issue?

Please help me to resolve this..

  • Ankita,

    I’m sorry, but I’m out of the office today. I’ll get to your questions at the beginning of next week.

    Joseph Wu

  • Ankita,

    1. ADC_DOUT is the output data which is comprised of two bytes. ADC_DOUTH is the upper byte and ADC_DOUTL is the lower byte. The data structure is described in Table 14, shown here:

    2. There is a lot that can be said about improving the accuracy of the measurement. For RTD measurements, the largest source of error would likely be the reference resistor that you use. In your schematic, this is labeled as R7. Any error in this resistor reflects as an error in the RTD measurement. This resistor should be a precision resistor with high accuracy and low drift. After that, you'll need to consider how the measurements are made to determine errors.

    There is an application note on RTD measurements that outlines different RTD topologies and some of the calculations used for making measurements. It was originally targeted to the ADS1248, ADS124S08, and other devices (mostly ADS12xx type devices), but the method of measurement would be the same for the LMP90098. You can find the RTD application note here:

    3. I think it is more efficient to monitor the DRDYB signal to find the output. It's best to use this line as an interrupt so that you can read data at the correct time, instead of polling the line.  

    4. Fluctuations for ADC_DOUT could be many things, depending on the magnitude. I'd need to know more about what values you're seeing, and what you are using to test the system. In general, I'd use use precision resistors for both the input and reference resistor when you make the test. If you have some data of a measurement, with the configuration settings, and inputs you used, I could give some recommendations. If you do send information, be detailed about your setup. In general, it helps to know what you used as the input, and what you expected to get out for data.

    Joseph Wu

  • Hi Joseph,

    Thanks for the reply,

    We are using Rref as 1k with tolerence 0.1% and for testing I have connected 180ohm resister which had tolerence of 5% and the RTD value after calculation was 189ohm, to cross verify I have replaced 180ohm with 220ohm of 5% tolerence, but RTD value was 278ohm. Is my register configuration is correct,and I have followed all the steps mentioned in the previous reply, what migth be the issue. Can I get driver file or library of this. And LMP90098 is 24bit ADC, sometimes ADCOUT value is 7FFFFF is it wrong.

    Here is the piece of code for reading the Resistance value: 

    while(1)

    {

    if(DRDY_Flg)
    {
    Temp_Val = ADC_Read(&hspi1);
    memset(Debug_Buf,'\0',strlen(Debug_Buf));
    sprintf(Debug_Buf,"ADCOut%02x\r\n",Temp_Val);
    HAL_UART_Transmit(&huart4,Debug_Buf,sizeof(Debug_Buf),200);
    }

    Flt_Temp_Val = ((((Temp_Val)*4000)/pow(2,24)) + 100);
    memset(Debug_Buf,'\0',strlen(Debug_Buf));
    sprintf(Debug_Buf,"Temp in ohms:%f\r\n",Flt_Temp_Val);
    HAL_UART_Transmit(&huart4,Debug_Buf,sizeof(Debug_Buf),200);
    HAL_Delay(2000);

    }

    Please let me know how to solve this issue.And it will be helpful if I get library file for the same

  • Ankita,


    The number that you show isn't exceptionally far of from expected. Instead of looking at the register values, I would check the board itself to see what might be wrong. (I'll look through the code after I get out a couple of suggestions).

    I don't know your exact setup so I'm not sure what configuration you are measuring, but I believe that you are using the equivalent of a 3-wire RTD with a low-side reference. I'm guessing that you don't have R92 connected.

    Using a precision multimeter, measure the reference voltage. Depending on what you have configured, this should be the IDAC current*2*1kΩ. Measure the voltage across the test resistance. This should be 1 IDAC current*test resistance. Note that you have a few series resistors. R14 and R9. These will add error if they are not exactly 0Ω. Also, it looks like you have added R10 for some sort of hardware compensation. We generally don't recommend this. You may be trying to increase the dynamic range by allowing for negative value measurements, but it usually just adds error to the measurement. You can also measure the voltage across R10 just to check the value.

    Finally, record the voltage as measured by the multimeter from VIN0 to VIN1. Using this, you can see if the ADC value comes out as expected. Again, I'll need you to record the multimeter measurements and I want you to compare them to the ADC output and expected ADC output. I would note that ADCOUT of 7FFFFF might indicate that the input is open, or the input is over-ranged.

    Read through my comments and make the measurements. Let me know what you get for results.

    I don't know if your problems are related to driver or library problems, but here are some code resources:

    Microcontroller Firmware Considerations for the LMP90100 Sensor AFE
    www.ti.com/.../snaa075a.pdf

    MSP430 Interface to LMP90100 Code Library
    www.ti.com/.../snaa134a.pdf

    MSP430 Sample Code
    www.ti.com/.../snac029


    Joseph Wu
  • Hi Joseph,

                 Thanks for the support, all the voltages measurement is  proper as per your suggestion and ADC_DOUT is as expected, by changing the scan mode to 0(single channel continuous scan), gain to 1 and resistance for 216ohm resister connected is giving with decimal point variation in value, but this point variation is making a major difference in degrees when RTD is connected(25-28 Deg variation).

    Regards,

    Ankita Kulkarni

  • Ankita,


    In order to track down these type of measurement errors, I'll need more information than you've provided. At this point, you're reporting that you have a 25-28° variation, but I need to know how much voltage and resistance error that is. Giving the temperature error does not help me debug errors in an electrical circuit. I need to see all the calculations that you've done and all the measurements that you've made. The measurements include the raw data coming from the ADC.

    If there is a measurement error, there might be some problem in the code, but it's more likely a problem with the circuit. Because of this, we need to try to relate the measurement error to electrical characteristics.

    When you report back your data and measurements, please be very detailed in the description. At this point, I'm not even clear on the real nature of your error. The way you've described this, it could be some noise problem or some gain or offset error.


    Joseph Wu

  • Hi Joseph,

    Measurement details,

    Reference Voltage= (IB1 +IB2)*Rref = (1+1)m*1k = 2V, but practically I'm get 1.96V

    Voltage across R10 = 95.7mV(practically)

    Differential Voltage (V0 - V1) = 111.9mV

    ADC_OUT to RTD calculation :

    RTD =  ((ADC_OUT *4*1k)/(2^24 * 1))+100   //Gain =1

    Temperature in Degrees calculation :

    Refering to PT-100 conversion chart- at 0deg - 100ohms & 70deg - 127.07ohms

    I used interpolation method:

    (Tdeg - 0)/(70 - 0) = (RTD - 100)/(127.07-100)

    i.e, Tdeg = ((RTD - 100)/27.07)*70

    For same environment, the ADC value is changing within 5secs,

    ex. at 11:37:21 the                                                                                                         At 11:37:28 

    ADCOUT = C18f                                                                                                            ADCOUT = bbed

    Resistance = 111.813881 ohms                                                                                     Resistance = 111.470078 ohms

    Temperature = 30.539335 Deg                                                                                       Temperature = 29.660143 Deg

    Will the RTD PT-100 will give this variation within a seconds, or something wrong while ADC sampling, as variation in temperature by 1 or 2 degs within a secs is not possible for the same environmental setup.

  • Ankita,

    I think it will be more efficient if I just go through some of what I think the error sources are. Then I'll describe what I think you should change.

    Here is a basic schematic of your measurement. You have a 3-wire RTD measurement, and you use 2 matched current sources to drive leads 1 and 2. IB1 drives lead1 and the RTD, while IB2 drives lead2. The currents are summed and go out lead3 to the reference resistor. Lead3 isn't measured from VIN0 and VIN1, so it doesn't figure into the measurement.

    Normally, IB1 and IB2 are used to cancel the lead resistance. Lead1*IB1 is added to the voltage from VIN0 to VIN1, while lead2*IB2 is subtracted. If the currents are the same and the lead resistances are the same, the values should cancel.

    However, in your circuit, you have R14 and R9 added to the schematic. These are functionally the same as the lead resistance. However, with 0Ω resistors and any solder joints, this adds some variability in the actual lead resistance. Normally you would have wanted to bypass these resistances to exclude the resistance in the measurement. I'll show a diagram later.

    Additionally, you have an added 100Ω resistance in the measurement. I generally wouldn't have used this at all. I mentioned this in a previous post. I'm sure the idea would have been to cancel the voltage so that you get positive and negative values so that you can increase the dynamic range of the measurement. In practice, this is very difficult to do. Again, you've added some variability with parasitic resistance in the solder connections. Additionally, IB1 and IB2 may not be perfectly matched. This error is 0.45% max and adds in error to the hardware compensation.

    As for the change of the voltage measurement within 5 seconds, this could be some sort of self heating. If you turn on the device, the current running through the RTD will cause some power dissipation. However, this value is usually very small. Normally with the values you've given, this would be a low value and the effective change in value would be less than 0.02°. However, because you have several resistors in the measurement, and the resistance from the solder joints will have a much higher change in resistance over temperature. I don't see any capacitance across the inputs or the reference. However, that may also have some contribution to measurements over time (although for input filtering capacitors, ususally the time constants are milliseconds or less).

    Instead of what you have shown, this is what I would have done:

    As mentioned before, I would have eliminated the hardware compensation (100Ω resistor) and bypassed the series resistances for IB1 and IB2. The conversion would be in resistance, based on the 1kΩ reference resistor. Regardless, the calculation still comes down to the same result as you would get from the application note that I had earlier referenced:

    .

    The result is shown in Equation 32 on page 15. Note that the conversion output is dependent on the reference resistor value, and you don't need to convert to an exact voltage. I just wanted the exact voltage to verify the measurement is working. With the compensation resistor, you get about 11.8Ω, for which you need to add the 100Ω resistor.

    Note that your error is in the tenths of an ohm range. Getting this kind of precision is difficult and it's even more difficult when you add in 0Ω resistors into the measurement.

    Going forward, I would eliminate the 100Ω resistor. I would also try using several different RTD values. You can use precision resistors as a substitute, but you'll need to attach a third connection to simulate a 3-wire RTD. If there are errors based on mismatching of IB1 and IB2 or from lead1 and lead2 (which includes the 0Ω resistors) you may be able to add some chopping of the currents to try to eliminate those errors. For your circuit, I'd review some of the descriptions in the application note. Page 5 covers the lead-wire cancellation, page 14 covers a 3-wire RTD application, pages 6 and 16 cover current chopping.

    Joseph Wu

  • Ankita,


    It's been a while since the last posting for this thread. I think the errors that you're seeing could be a combination of the parasitic resistance in the measurement and the mismatch in the excitation current sources IB1 and IB2. Hopefully, you've been able to test and prove this out in your own schematic.

    I'll close this post for now, but if you continue to find errors in your measurement, post back and we can continue to review your schematic.


    Joseph Wu