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

Can VDD be measured? (without routing it to an GPIO)

No text. It's a really short question.

So this is a simple example:

	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);
					NRF_ADC->ENABLE = ADC_ENABLE_ENABLE_Enabled;							
					NRF_ADC->TASKS_START = 1;
					nrf_delay_ms(1);
					uint8_t raw_voltage = NRF_ADC->RESULT;
					printf("%3.2fV\n", raw_voltage*0.0140625);

2,88V. nRF51-DK connected via USB. Works.

Related