This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51822 ADC battery level detection example question

Based on nRF51822\Board\pca10001\ble\ble_app_hrs example, How nRF51822 detect ADC input? Which ADC pin?

Configuration code: NRF_ADC->CONFIG = (ADC_CONFIG_RES_8bit << ADC_CONFIG_RES_Pos) | (ADC_CONFIG_INPSEL_SupplyOneThirdPrescaling << ADC_CONFIG_INPSEL_Pos) | (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) | (ADC_CONFIG_PSEL_Disabled << ADC_CONFIG_PSEL_Pos) | (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);

From the configuration above, ADC_PSEL register is selected as DISABLE,0 and analog input pin disabled. Does it means nRF51822 take input voltage (Vcc) as ADC analog input pin?If not, how does it works?

Parents
  • As you can see, the INPSEL field is set to be the supply. If you take a look at the description of the CONFIG register in the reference manual, you can see that the PSEL field is used only if the INPSEL is set to one of the fields where the description says it will be used. For both the Supply values, the VDD is used as an input, and the PSEL field is not used.

Reply
  • As you can see, the INPSEL field is set to be the supply. If you take a look at the description of the CONFIG register in the reference manual, you can see that the PSEL field is used only if the INPSEL is set to one of the fields where the description says it will be used. For both the Supply values, the VDD is used as an input, and the PSEL field is not used.

Children
Related