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.

TMS570LC4357: Temperature sensor and MibADC reading scaling when reference is not 3.3V

Part Number: TMS570LC4357

Hi,

In our project, we use the Temperature Sensor 1 of the TMS570LC4357.

All necessary steps to activate the temperature sensors (IOMM) and the MibADC1 (clocks in PCR3, MIBADC1 registers configuration) and I can read the ADC reading that match with the ambient temperature.

In our system, the ADC reference voltage on ADREFHI is 2.048V. As indicated in the TI Application Note SPNA216, the calibration data were produced with ADREF at 3.3V, then a scaling of the temperature is necessary. According to the application note, this can be done by applying a ratio factor to the thermistor_read() function return value.

Because the operation to get the temperature is temp_K = (ADC_Reading - Offset) * Slope, that means that for an ADC reading of 0x000, the temperature in Kelvin would change depending on the ADREF.

If the temperature sensor is powered by an other reference (coming from the CPU and not from the ADREF) then in my opinion, only the ADC readings needs to be rescaled.

With that idea, I performed offset and slope computation based on TI OTP calibration data, but with first rescaling the ADC readings, and for a standard linear equation of temp_K = Slope * ADC_Reading + Offset. The results gave different slopes if the reference on ADREF is not the same, but the offsets are the same, meaning for an ADC value of 0x000, the temperature (Kelvin) is the same, that makes more sense to me.

So here are my questions:

  • Are my assumptions correct?
  • Is the scaling method from the application note correct?
  • If ADREF changes the ADC readings for the same input voltage on the channel, then what is the reference voltage of the temperature sensor? Is it related to ADREFHI/ADRELOW? VCCAD/VSSAD? other supply?

Best regards,

Gael

  • Hello Gael,
    Your question is forwarded to our ADC expert.
    Due to the US holiday the responses may be delayed until the week of November 26th.

    Best regards,
    Miro
  • Hi,
    No problem, thanks for the update.
    Gael
  • Hi Gael,

    The ADC conversion result is inversely proportional to the ADREFHI value. Assuming that the ADREFLO is 0V, ADC_value = 4096 * Vin / ADREFHI.

    The algorithm used in the application note includes comments to scale the conversion results based on your ADREFHI value. The values stored in the OTP are valid for ADREFHI = 3.3V. These need to be scaled for your reference of 2.048V as ADC_val * 3.3 / 2.048

    Regards,
    Sunil
  • Hi,
    Ok, we agree that it needs to be scaled.
    But the Application Note explains that in order to do that, we need to apply the scaling factor to the result given by the thermistor_read function.
    In your reply, you wrote that ADC samples in OTP memory needs to be scaled using ADC_value_scaled = ADC_value_from_OTP * 3.3 / 2.048.
    In those two scenarios, thermistor_read() function won't give the same results for an ADC value read with an other ADREFHI that 3.3V.

    Gael
  • Gael,

    You can apply the scaling in the thermistor_calibration() routine, just before the ADC values are used in the calculations for the slope and the offset. There would be no more scaling required after this.

    Regards,
    Sunil
  • Hi,

    Applying the scaling on the values from OTP before computing slope and offset has not the same effect as applying the scaling as documented in the application Note SPNA216 (on the thermistor_read function return value), per the following comment from the thermistor_read function:

    /*

    * The returned temperature will need to be scaled by the reference voltage difference

    * Calibration values are taken at nominal voltage 3.30V.

    *

    * Kelvin = ReturnValue * (VccADrefHi - VccADrefLow)/3.30V

    */

    In order to clarify the differences, I made an excel sheet showing the results for each solution, given the same ADC values. Please see attached file.

    Then, do you confirm that scaling needs to be done on the OTP memorized samples?

    If you do, this makes the thermistor_read function comment wrong and the application note would need to be corrected to prevent people from computing incorrect values when 3.3V is not used as ADC reference.

    Thanks,

    Gael

    5684.ADC conversion methods comparison.xlsx

  • Gael,

    I agree that the app note needs to be updated to indicate that the scaling for different ADC reference voltages needs to be done in the thermistor_calibration() function.

    Regards,
    Sunil
  • Thanks for the clarification.

    Best regards,

    Gael