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.

关于CC2540内部温度以及ADC的两个问题



1.ADC值的读取

uint GetAdcValue(void)
{
uint AdValue=0;

ADCCON1 |= 0x40;
while(!(ADCCON1 & 0x80));
AdValue = ADCL >>4;
AdValue |= ADCH <<4;

return AdValue;
}

为什么AD值的读取是这么计算的,按照寄存器说明,ADCL只有低两位是无效的啊?

2.内部温度计算

uint TempDeal(uint TempAdValue)//将温度传感器的Ad值转换成温度值,扩大100倍
{
float Tempruture;
Tempruture = (TempAdValue-1367.5)/4.5+2.5;
TempAdValue = (uint)(Tempruture*100);
return TempAdValue;
}

这个网蜂蓝牙的例程,为什么这么计算?