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