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

ADC Result not changing w/respect to Analog input

Hello,

I am trying to read data from nRF51422 ADC using SDK51 PCA10028 board downloaded with S130. I tried one of existing ADC with Softdevice examples, it seems to work for the most part but the data I am getting is always the same ( 0xA5).

The ADC initialization looks okay and I checked it with the Keil debugger, the values are set correctly. The ADC and timer interrupts work correctly. I also get correct ADC result when I change the prescaling input to: ADC_CONFIG_INPSEL_SupplyOneThirdPrescaling which I get 0x344 for result.

I spent a lot of time looking here and on Github for similar problems/solutions to no avail. So far I tried analog inputs P0.00-P0.02, the result is constant for all cases even though the analog input voltage is either set to 0 or 3.3v. I don't know if this is DK problem or something else.

main.c

Related