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

nrf51822 ANAEN

Referring to page 58 of the reference manual there is a ANAEN control signal that will contect a gpio pin to a corresponding analog input

I am using GPIO P0.01 -> AIN2 Eval board

What mechanism is used to control ANAEN? Do we need to explicitly write this value in a GPIO config register. This is not very well sited in the documentation ANAEN appears no where else in the document.

Parents
  • So then does the ADC_CONFIG_PSEL_AnalogInputXXX(2 in my situation) automatically enable the corresponding GPIO pin for operation as an analog input?

    NRF_ADC->CONFIG = (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos) | (ADC_CONFIG_INPSEL_AnalogInputNoPrescaling << ADC_CONFIG_INPSEL_Pos) | (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) | (ADC_CONFIG_PSEL_AnalogInput0 << ADC_CONFIG_PSEL_Pos) | (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);

Reply
  • So then does the ADC_CONFIG_PSEL_AnalogInputXXX(2 in my situation) automatically enable the corresponding GPIO pin for operation as an analog input?

    NRF_ADC->CONFIG = (ADC_CONFIG_RES_10bit << ADC_CONFIG_RES_Pos) | (ADC_CONFIG_INPSEL_AnalogInputNoPrescaling << ADC_CONFIG_INPSEL_Pos) | (ADC_CONFIG_REFSEL_VBG << ADC_CONFIG_REFSEL_Pos) | (ADC_CONFIG_PSEL_AnalogInput0 << ADC_CONFIG_PSEL_Pos) | (ADC_CONFIG_EXTREFSEL_None << ADC_CONFIG_EXTREFSEL_Pos);

Children
Related