Hi BU experts,
Customer and I both tested the sample chip (customer part number is XF2800157QPMQ $7A-2CA9DE), and found that when calling "GetTemperatureC" to get the junction temperature, the result was not right. And we finally found that it is caused by both ADC_EXT_REF_TSSLOPE and ADC_EXT_REF_TSOFFSET are zero.
//
// Defines
//
#define ADC_EXT_REF_TSSLOPE (*(int16_t *)((uintptr_t)0x701C8)) //Slope of temperature sensor
#define ADC_EXT_REF_TSOFFSET (*(int16_t *)((uintptr_t)0x701C9)) //Temperature offset
#define ADC_INT_REF_TSSLOPE (*(int16_t *)((uintptr_t)0x701CA))
#define ADC_INT_REF_TSOFFSET (*(int16_t *)((uintptr_t)0x701CB))
//
// GetTemperatureC - This function uses the reference data stored in OTP to
// convert the raw temperature sensor reading into degrees C
//
int16_t GetTemperatureC(uint16_t sensorSample)
{
float32_t temp;
temp = (float32_t)((tempSensor_scaleFactor / 2.5F) * sensorSample);
//
//Read the Slope and Offset from OTP
//
tempSensor_tempSlope = ADC_EXT_REF_TSSLOPE;
tempSensor_tempOffset = ADC_EXT_REF_TSOFFSET;
return((int16_t)((((int32_t)temp - tempSensor_tempOffset) * 4096) /
tempSensor_tempSlope));
}
I want to check with you if the above OTP address are right or not, or was TI missing to burn the OTP value into this sample chip part number?
Regards,
Will