Hi,
I have been playing around with the nRF9160 DK trying to get it reading a range of sensors, so far with success, however I have found an issue which has stumped me. I am using ADC0 to read a voltage. Although this is intended for a pressure transducer, for debugging I have just put the 5V out through a resistive divider (10K / 10K) and the ADC successfully reads 2.5V.
However, when the program is first run, the very first ADC reading is around 50. The next one, and all instances after, it reads correctly (around 3500 - using 3V VDD as reference and gain of 1/4, 12-bit resolution).
I assumed this may be due to acquisition time, but I tried a few different values and nothing helped.
I wont post the full code, but here is the config and read code
The adc_sample() function is called when button 1 is pressed, but I'm sure that shouldnt make a difference.
Thanks,
Damien