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

nRF52-DK: measuring Vdd (simple) with ACD (SDK V15.0.0)

Hello,

I run the example given in SDK V15.0.0 to measure Vdd of nRF52-DK:

NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_VDD);

I don't change the default param:

- resolution = 10 bits

- ref = 0.6V

- gain = 1/6

As seen in console, I obtain an average value of 815

which gives:  815* 0.6 / 1024 * 6 = 2.87 Volts which is right for the nRF52832.

The problem is that if I change the resolution (to 8 bits or 14 bits) then I keep finding the same value of 815 ...  how do you explain that?

Thanks,

John.

Parents Reply Children
  • Yes you're right!   I just realized I were changing this one instead:

    #ifndef NRFX_SAADC_CONFIG_RESOLUTION
    #define NRFX_SAADC_CONFIG_RESOLUTION 0
    #endif

    It's confusing because these 2 drivers are enabled in the example given in SDK:

    And the NRFX can be unchecked in there. Which is strange BTW because the NFRX_ are supposed to be the new versions and the other one whitout the prefix NFRX_ is the legacy one.

    Thanks.

  • No wonder you are confused. 

    In SDK 15 we introduced the nrfx drivers in an attempt to prepare for future IC releases. However, we also decided to keep the legacy drivers so that customers who already had projects based on the old drivers could upgrade to SDK 15 without too much porting. 

    Most of the examples in SDK 15 use legacy function namespaces (e.g. nrf_drv_saadc_buffer_convert), but also a "glue"-layer to convert these namespaces to the new nrfx namespace (nrf_drv_saadc_buffer_convert -> nrfx_saadc_buffer_convert). So even though the examples use the legacy namespace on the "front" it is actually the nrfx drivers that er being used under the hood. 

    So yes, SDK 15 might seem like somewhat of a patchwork, but it is just a transition phase. 

Related