请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F2800157-Q1 尊敬的 BU 专家:
客户和我都测试了样片芯片(客户器件型号为 XF2800157QPMQ 7A-2CA9DE)、发现在调用"GetTemperatureC"来获取结温时、结果不正确。 我们最终发现它是由 ADC_EXT_REF_TSSLOPE 和 ADC_EXT_REF_TSOFFSET 引起的、其值均为零。
//
// 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));
}
我想向您确认上述 OTP 地址是否正确、或者 TI 是否未能将 OTP 值刻录到此样片芯片器件型号中?
此致、
怎样的