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.

ADC值转化为实际电压

咨询一点问题:

我想要通过P0_5引脚读取ADC值,然后转化为实际电压,配置如下:

P0SEL |= 0x20;

P0DIR &= ~0x20;

HalAdcSetReference(HAL_ADC_REF_125V);
uint16 adc = HalAdcRead(HAL_ADC_CHN_AIN5,HAL_ADC_RESOLUTION_12);

这样读出的ADC值,转化为实际电压,adc/2047 = Vcc/(1.15*3)

这样计算出来的Vcc应该就是实际电压吧?我计算出来的电压和实际电压存在很大误差,请问一下是我配置有问题吗?