Hello ,I work with the sdk 12, I have a program to contoler the level of battery, it works, except that I recode 3870 mV (with USB) and when I measure the pin VDD I find 2.88. I do not know is what I made a code fault thanks
Hello ,I work with the sdk 12, I have a program to contoler the level of battery, it works, except that I recode 3870 mV (with USB) and when I measure the pin VDD I find 2.88. I do not know is what I made a code fault thanks
Do you use the SAADC? What is the gain and reference set to? And what code do you use to convert to mV?
There is one thing I'd like you to try, use int16_t instead of uint16_t for batt_lvl... . The SAADC output is two's complement.
3870mV as output suggest that you get 1024 as output, which could indicate that the config is not using 1/6 gain.
Hello,thanks . yes I actually get 1024, I do not know where the problem
I always get 1024 for ADC RESULT AND 3870 for the batt despite I changed the uint16-t to int16-t
Check the NRF_SAADC->CH[0].CONFIG register to verify that the gain is really set at 1/6