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

Migrating SAADC Low Power from SDKv11 to v12

I downloaded the nrf52 SAADC Low power project from the GitHub github.com/.../saadc_low_power I'm trying to migrate it over to version 12 of the SDK and I think I'm having problems in the sdk_config.h file.

The version 11 changed some RTC values in the nrf_drv_config.h file which is as follows below and I'm wondering how I can make the equivalent changes to the sdk_config.h file.

RTC0 Disabled

RTC1 Disabled

RTC2 Enabled

RTC2 Freq 32

NRF Max Latency US 2000

Version 11 config file nrf_drv_config.h

Parents
  • Hi Kevin,

    A low power mode was added to the SAADC driver in SDK 12.x. You enable it by setting low_power_mode to 1 in the nrf_drv_saadc_config_t struct.

    If you still want to port the GitHub example, then as you have coorectly pointed out, you have to edit the sdk_config.h file. I recommend that you start with the sdk_config.h file from the ble_app_template, which includes all the peripheral settings( the examples only include the peripherals they use).

    If you plan on using the low power github example in an application that uses the S132 SoftDevice, then you should be aware that the SoftDevice uses the RTC0, and should therefore be enabled. You can see which Hardware peripherals that are used by the SD when it is enabled on this Infocenter page.

    Best regards

    Bjørn

  • Hi Labi, if the low power mode bit is set in the config struct, then it will result in the SAADC peripheral initializing when sampling and uninitializing when sampling is complete. This will enable EasyDMA only during sampling, but leave it disabled when not sampling. The EasyDMA consumes around 1.5mA when enabled. This feature was based on this Github example.

Reply Children
No Data
Related