I'm using PCA10040 for studying nRF SDK, and I tried running the sample 'saadc_pc10040' with the following change in the 'config.h':
#define NRFX_SAADC_CONFIG_RESOLUTION 2
I connected the board to my PC via USB and applied an external power source with the negative terminal connected to GND and +0.6V to P0.02.
At this point, I expected the ADC value (p_event->data.done.p_buffer) to be calculated as follows:
RESULT = [V(P) – V(N)] * GAIN/REFERENCE * 2^(RESOLUTION - m)
Where:
- V(P) is the voltage at input P
- V(N) is the voltage at input N
- GAIN is the selected gain setting
- REFERENCE is the selected reference voltage
- m = 0 if CONFIG.MODE=SE, or m = 1 if CONFIG.MODE=Diff.
In this case:
- V(P) = 0.6
- V(N) = 0.0
- GAIN = 1/6
- REFERENCE = 0.6
- m = 0
So, I expected to get the result as:
[0.6 – 0.0] * (1/6)/0.6 * 2^(12 - 0) = 682
However, in reality, I got 62000.
Can you please explain why this is happening?