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.

CC2530片内温度传感器温度如何校正?

Other Parts Discussed in Thread: Z-STACK, CC2530

最近在使用CC2530的片内温度传感器做一个温度采集的系统,在Z-Stack里做的开发,现在网络能组建了,也实现了温度数据的发送和接收。但发现采集得到的温度值不理想,使用的温度采集代码如下:

  • float getTemperature(void)
  • {
  • uint value;
  • ADCCON3 = (0x3E);                             //选择1.25V为参考电压;14位分辨率;对片内温度传感器采样
  • ADCCON1 |= 0x30;                              //选择ADC的启动模式为手动
  • ADCCON1 |= 0x40;                              /启动AD转化
  • while(!(ADCCON1 & 0x80));              //等待 AD 转换完成
  • value = ADCL >> 4;                             //ADCL 寄存器低 2 位无效
  • value |= (((UINT16)ADCH) << 4);
  • return (value-1367.5)/4.5;                / /根据 AD 值,计算出实际的温度
  • }
请问,上述代码正确么?要怎么校正才能使片内温度传感器的值更准确呢?谢谢!