Hi
I am looking for pin numbers for the nRF51822 microcontroller.
example like what are the pin numbers for VDD to measure battery voltage..??
I mean in which header file it was defined..? We have custom nRF51 boards.
Hi
I am looking for pin numbers for the nRF51822 microcontroller.
example like what are the pin numbers for VDD to measure battery voltage..??
I mean in which header file it was defined..? We have custom nRF51 boards.
You can find the pin numbers in the Product Specification (Chapter 2.2).
In order to measure VDD using the ADC:
Choose VBG as reference voltage. This is an internal 1.2V reference voltage.
Use NRF_ADC_CONFIG_INPUT_DISABLED to disconnect the analog inputs on the GPIOs.
Use "Supply one third prescaling" as input. This will connect VDD/3 to your ADC.
Now you can measure VDD without any external components at all.
At the Nordic Semiconductor GitHub page, we have an example that does this: github.com/.../ble_app_hrs_adc_battery_measurement
Note: In the example you need to uncomment line 1019 and 1020 in main.c, to sample the supply voltage of the nRF51 directly (not from a pin)
Note: In the example you need to uncomment line 1019 and 1020 in main.c, to sample the supply voltage of the nRF51 directly (not from a pin)