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.

TMS320F280049C: values from internal temperature sensor off

Part Number: TMS320F280049C

Hello Experts,

working with the internal temperature sensor on the TMS320F280049C and using the on chip calibration values, I am getting return values of -102°C at room temperature.

For the conversion, ADC_getTemperatureC from the driver library is called in the ISR after picking up the raw ADC value. Code looks like this:

    // read CPU Temp adc value
    pADCData->rawVSEN_TCPU = ADC_readResult(MTR1_TEMP_ADCRES_BASE, MTR1_TCPU_ADC_SOC_NUM);
    value_ui16 = pADCData->rawVSEN_TCPU;
    pADCData->TempCPU = ADC_getTemperatureK(value_ui16, 3.3F);

The S/H window time is set to 450 ns as given in the TRM (I've also tried longer times up to 10 us without improvement), and the internal 3.3V Vref is used.

The raw values comming from the ADC are around 901 at turn one and go up to 926 after 5 or 10 minutes runing. Is this an rxpected raw value for room temperature?

The on-chip ext calibration values are 1830 for the offset and 24404 for the slope. Are these in the right range?

In ADC.h there are also symbols for internal calibration values:

#define ADC_INT_REF_TSSLOPE  (*(int16_t *)((uintptr_t)0x705BD))
#define ADC_INT_REF_TSOFFSET (*(int16_t *)((uintptr_t)0x705BE))

While these values return -38°C at room temperature, they are still not within the range of +- 15°C as specified in the datasheet or +- 20°C when using the int Vref as mentioned in the forums:

tms320f280049-internal-temperature-sensor-with-adc-internal-reference

What to do?

As a side note: at first the conversion was giving completely eratic return values. After turing off the IDIV option, the values started coming in consistent as expected.

Kind Regards,

John

  • Hi John,

    Is line#4 on the embedded code snippet a typo? pADCData->TempCPU = ADC_getTemperatureK(value_ui16, 3.3F);.  You should use ADC_getTemperatureC.  Anyhow, 901 to 926 ADC values are a bit low.  Slope and offset values are at the expected ranges.  Can you try switching to 2.5V internal to see if the ADC converted values change accordingly?  It could be that there is a VREFHI contention occurring here. 

    By the way, thanks for providing all the details like raw ADC data, slope and offset values.  It makes debugging a lot easier.

    Best regards,

    Joseph

  • Hello Joseph,

    thank you for your suggestion. I switched the Vref for all ADCs from 3.3V to 2.5V:

        ADC_setVREF(obj->adcHandle[0], ADC_REFERENCE_INTERNAL, ADC_REFERENCE_2_5V);
        ADC_setVREF(obj->adcHandle[1], ADC_REFERENCE_INTERNAL, ADC_REFERENCE_2_5V);
        ADC_setVREF(obj->adcHandle[2], ADC_REFERENCE_INTERNAL, ADC_REFERENCE_2_5V);

    with the result that the ADC raw value dropped from 924 to 831 and ADC_getTemperatureC returns resturns a temperature of -167 °C. How would you evaluate this?

    I have also checke the offset values and the return values on other prototype boards with similiar results, so it seems to be systematic mistake.

    In answer to your first question, I also tried using ADC_getTemperatureK from the driverlib (unfortunately, without improvement). You have a good eye. I copied the wrong code :-(

    Kind regards,

    John

  • Hi John,

    Seems like there is contention on VREFHI pin.  Which pin package are you using, 100PZ, 64PM or the 56RSH?  Is there any way to measure VREHI voltage on the board?  For internal VREF mode, the reference voltage still has to be brought out of the device to the VREFHI pin so that it can have the VREFHI cap externally as it is impractical to have the minimum 2.2uF to be on-chip. An internal 2.5VREF would produce just that on VREFHI pin.  An internal 3.3VREF would have half that value on VREFHI pin.

    At room temperature, the raw value should be 2000 for the part that you are looking at 2.5V internal vref if VREFHI pin measurement produces 2.5V.

    Best regards,

    Joseph

  • Hello Joseph,

    Our prototype has the 56RSH silicon revision B:

    F280049C RSHS Rev B

    We started using the internal VREF mode at 3.3V and a 2.2uF is connected between VREFHI and GND as recommended in the datasheet:

    Cap on VREFHI

    The voltage across C74 is 1,649 V in internal 3.3Vref mode and 2.496 V in internal 2.5Vref mode.

    Is it possible to resolve this contention?
    Where can it come from?
    The voltages across C74 seem to fit with your description. Would increasing the size of C74 alleviate this issue?

    Kind Regards,

    John

  • Hi Jack,

    VREFHI output on the external pin is as expected on those internal modes and there are no other paths that seem to be loading the VREFHI pin externally so we can rule out VREFHI as the issue.  Can you also please check on the two items below:

         - What is the setting of bit TSNSCTL.ENABLE?  This should be set to '1' for the temp sensor to be connected to the ADC

         - What is the channel and module being converted for temp sensor readings?  This should be on ADCB on channel 14

    Thanks and regards.

    Joseph

  • Hello Joseph,

    That was it! The ADC was reading from channel 14 (the right one), but from base C instead of B. Now the ADC values are coming in around 1511 and the ADC routine returns a value of 27.0 °C which fits at room temperature.

    So, topic resolved. Thank much for your support.

    Kind regards,

    John