请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320F2800157-Q1 主题中讨论的其他器件:C2000WARE
你(们)好
我需要有关 OTP 斜率地址和 OTP 偏移地址的信息、以便通过内部温度传感器的 ADC 值计算温度。 数据表中没有可用信息。 请帮帮我。
谢谢、
Rohit Nilagar
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.
你(们)好
我需要有关 OTP 斜率地址和 OTP 偏移地址的信息、以便通过内部温度传感器的 ADC 值计算温度。 数据表中没有可用信息。 请帮帮我。
谢谢、
Rohit Nilagar
您好、Rohit、
感谢您的提问。 C2000Ware driverlib 实际上已经为您在每个器件的"adc.h"文件中使用定义了这些值。 请安装最新的 C2000Ware (在过去一周内发布)、并查看以下定义和函数:
#define ADC_EXT_REF_TSSLOPE (*(int16_t *)((uintptr_t)0x701B2))
#define ADC_EXT_REF_TSOFFSET (*(int16_t *)((uintptr_t)0x701B3))
// temp sense calculation
static inline int16_t
ADC_getTemperatureC(uint16_t tempResult, float32_t vref)
{
float32_t temp;
//
// Read temp sensor slope and offset locations from OTP and convert
//
temp = (float32_t)tempResult * (vref / 2.5F);
return((int16_t)((((int32_t)temp - ADC_EXT_REF_TSOFFSET) * 4096) /
ADC_EXT_REF_TSSLOPE));
}
此致、
Vince