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.

CC2541 ADC采集数据错误

Other Parts Discussed in Thread: CC2541

我使用CC2541的ADC采集电池电压,参考电压为内部电压1.25V,输入为1.12V,分辨率为HAL_ADC_RESOLUTION_10,采集出来数据是172,而不是1.12/1.25*2^9 = 458,这是为什么呢?程序如下:

    for(i = 0; i < 64; i++)
    {
      HalAdcSetReference(HAL_ADC_REF_125V);
      adc += HalAdcRead( HAL_ADC_CHN_AIN0, HAL_ADC_RESOLUTION_10);
    }
    
    adc = adc >> 6;