This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How are hardware pins mapped to ADC_CONFIG_PSEL_AnalogInput*?

I found this recent Q&A very helpful on the topic of reading voltage on analog hardware pins via the ADC: devzone.nordicsemi.com/.../

In that Q&A, a helpful Nordic person pointed out that the comments at the top of this file in Github clearly state that if you want to read the voltage on hardware pin P0.01 you want to specify NRF_ADC_CONFIG_INPUT_2. github.com/.../main.c

I extrapolated a little bit from that and guessed that since my sensor is attached to hardware pin P0.02 on my Beacon that I should probably specify NRF_ADC_CONFIG_INPUT_3 in my code. It appears to work! And thank you!

But here's my question: where is this mapping laid out more completely and authoritatively in the documentation? I'm sure Nordic was more thorough than that, but I can't find it! What am I missing?

Parents
  • The pin layouts are in the product specifications for each of the chips.

    infocenter.nordicsemi.com/.../nRF51822_PS_v3.2.pdf

    That's the latest 51822 one, which is basically the same as the 51422 one, you can find them from the SDK and Documentation links above.

    Pin assignments for the QFN48 (for instance) are in table 2.2.1.1 which shows which GPIO maps to which analog pin. The pin assignments are different for the other package, so you need to use the correct map for the chip variant you're using.

Reply
  • The pin layouts are in the product specifications for each of the chips.

    infocenter.nordicsemi.com/.../nRF51822_PS_v3.2.pdf

    That's the latest 51822 one, which is basically the same as the 51422 one, you can find them from the SDK and Documentation links above.

    Pin assignments for the QFN48 (for instance) are in table 2.2.1.1 which shows which GPIO maps to which analog pin. The pin assignments are different for the other package, so you need to use the correct map for the chip variant you're using.

Children
Related