Help with computing correct SAADC output value

I am using an Nrf52840 and sdk V14.2.0.

My question is how to compute the battery voltage based on my hardware.

The hardware uses AIN0 to measure.

The hardware has a resistor divider: GPIO output pin >---806K---X---->2M------>GND.

AIN0 is connected at point X above. The GPIO pin is configured as an output and set to a logic 1.

How would I scale the reading taken this way to represent a supply voltage of 3V?

With 3V as VDD AIN0 would see 2V I believe.

I use default config so gain is 1/6.

Battery has no protection diode in series.

Thanks.

Parents Reply Children
Related