Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SAADC on nRF52-DK unexpected result

Using SDK_14 and unmodified SAADC example on pca10040.

Initially connected A0 (PO.03) to ground but getting seemingly random values.

<info> app: ADC event number: 586

<info> app: 293

<info> app: 76

<info> app: 24

<info> app: 292

<info> app: 208

Same result on an earlier SDK version.

Possible hardware problem? unilikely.

Any suggestions pls.

Parents
  • Hi,

    P0.03 is AIN1. If the application is setup to sample AIN0, you need to ground P0.02 to see the desired behavior. Note that the markings in parenthesis on the DK is related to Arduino form factor and not to the nRF pinout. Please have a look at the nRF52832 Pin assignment documentation.

    Best regards,
    Jørgen

  • Thx Jørgen

    As you may have guessed I did not locate the definition of NRF_SAADC_INPUT_AIN0.  I still have not but amm using PO.02 now.

    I'm now getting sensible values in the region of -9  (avg) when grounded and about 813 (avg) when connected to VDD

    To convert, I am reading that I need to multiply by 

    * GAIN/REFERENCE * 2^RESOLUTION

    This doc should probably say
    * GAIN/(REFERENCE * 2^RESOLUTION)

    Given this NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);

    Gain = presumably 6 (NRF_SAADC_GAIN1_6)

    Reference presumably about 4v (can't find NRF_SAADC_REFERENCE_INTERNAL)

    Resolution = SAADC_CONFIG_RESOLUTION 1 = 10 bit

    .. which would put VDD at 1.19v (multimeter tells me it's 2.85)

    So I conclude we're almost there but I need to locate the definitions for the other 2 constants.
    Thx for pointing me to these.





Reply
  • Thx Jørgen

    As you may have guessed I did not locate the definition of NRF_SAADC_INPUT_AIN0.  I still have not but amm using PO.02 now.

    I'm now getting sensible values in the region of -9  (avg) when grounded and about 813 (avg) when connected to VDD

    To convert, I am reading that I need to multiply by 

    * GAIN/REFERENCE * 2^RESOLUTION

    This doc should probably say
    * GAIN/(REFERENCE * 2^RESOLUTION)

    Given this NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);

    Gain = presumably 6 (NRF_SAADC_GAIN1_6)

    Reference presumably about 4v (can't find NRF_SAADC_REFERENCE_INTERNAL)

    Resolution = SAADC_CONFIG_RESOLUTION 1 = 10 bit

    .. which would put VDD at 1.19v (multimeter tells me it's 2.85)

    So I conclude we're almost there but I need to locate the definitions for the other 2 constants.
    Thx for pointing me to these.





Children
No Data
Related