TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F28035 ADC采用外部参考源3.0V如何计算CPU内部温度

TMS320F28035 ADC采用内部参考源时,CPU内部温度采样正常;

代码如下:

// Useful definitions
#define FP_SCALE 32768 //Scale factor for Q15 fixed point numbers (2^15)
#define FP_ROUND FP_SCALE/2 //Added to Q15 numbers before converting to integer to round the number

// Amount to add to Q15 fixed point numbers to shift from Celsius to Kelvin
// (Converting guarantees number is positive, which makes rounding more efficient)
#define KELVIN 273
#define KELVIN_OFF FP_SCALE*KELVIN

// The folloing pointers to function calls are:
//Slope of temperature sensor (deg. C / ADC code). Stored in fixed point Q15 format.
#define getTempSlope() (*(int (*)(void))0x3D7E82)()
//ADC code corresponding to temperature sensor output at 0 deg. C
#define getTempOffset() (*(int (*)(void))0x3D7E85)()

//This function uses the reference data stored in OTP to convert the raw temperature
//sensor reading into degrees C
int16 GetTemperatureC(int16 sensorSample)
{
return ((sensorSample – getTempOffset())*(int32)getTempSlope() + FP_ROUND + KELVIN_OFF)/FP_SCALE – KELVIN;
}

//This function uses the reference data stored in OTP to convert the raw temperature
//sensor reading into degrees K
int16 GetTemperatureK(int16 sensorSample)
{
return ((sensorSample – getTempOffset())*(int32)getTempSlope() + FP_ROUND + KELVIN_OFF)/FP_SCALE;
}

当改为外部参考源时,CPU内部温度如何计算?

还是说CPU内部温度采样只能采用内部参考源?

user4938334:

回复 笨鸟:

请问改变参考电源后怎么确定TempSensorOffset 和TempSensorSlope

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F28035 ADC采用外部参考源3.0V如何计算CPU内部温度
分享到: 更多 (0)