How can i enable dcdc regulator

Hi everybody,

I want to try dcdc module. I want to figure out How can i reduce current consumption.

I have a this 2 configuration in sdk_config.h

1) 

// <e> POWER_ENABLED - nrf_drv_power - POWER peripheral driver - legacy layer
//==========================================================
#ifndef POWER_ENABLE
#define POWER_ENABLED 0
#endif
// <o> POWER_CONFIG_IRQ_PRIORITY  - Interrupt priority
 

// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7

#ifndef POWER_CONFIG_IRQ_PRIORITY
#define POWER_CONFIG_IRQ_PRIORITY 6
#endif

// <q> POWER_CONFIG_DEFAULT_DCDCEN  - The default configuration of main DCDC regulator
 

// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.

#ifndef POWER_CONFIG_DEFAULT_DCDCEN
#define POWER_CONFIG_DEFAULT_DCDCEN 1
#endif

// <q> POWER_CONFIG_DEFAULT_DCDCENHV  - The default configuration of High Voltage DCDC regulator
 

// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.

#ifndef POWER_CONFIG_DEFAULT_DCDCENHV
#define POWER_CONFIG_DEFAULT_DCDCENHV 0
#endif

// </e>


2)
// <e> NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver
//==========================================================
#ifndef NRFX_POWER_ENABLED
#define NRFX_POWER_ENABLED 0
#endif
// <o> NRFX_POWER_CONFIG_IRQ_PRIORITY  - Interrupt priority
 
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7

#ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY
#define NRFX_POWER_CONFIG_IRQ_PRIORITY 6
#endif

// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCEN  - The default configuration of main DCDC regulator
 

// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.

#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN
#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 1
#endif

// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCENHV  - The default configuration of High Voltage DCDC regulator
 

// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.

#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV
#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0
#endif

// </e>

What is the differences between these two configurations?

and is this enough for enable dcdc regülator.


Parents
  • The reason some of the definitions say NRFX while others doesn't is only for backwards compatibility. If you open your application project, and search for the apply_old_config.h.

    In the end, it is the NRFX_POWER_CONFIG_DEFAULT_DCDCEN that is being used, but it may not be the same as you define it to be in the sdk_config.h. You can see in the apply_old_config.h file that if the POWER_ENABLED is defined (it can be set to 0 but still be defined), it will undef NRFX_POWER_CONFIG_DEFAULT_DCDCEN and then redefine it to be equal to POWER_CONFIG_DEFAULT_DCDCEN. 

    However, I never remember which way this goes without looking it up in the apply_old_config.h file, so I ususally just set them to be equal in sdk_config.h.

    You may also need to add the file SDK\modules\nrfx\drivers\src\nrfx_power.c, if you have not already included it. You also need to call nrf_drv_power_init(NULL), and include the files needed for this, such as SDK\integration\nrfx\legacy\nrf_drv_power.c

    When this is called, it will call nrfx_power_init() with p_config.dcdcen = NRFX_POWER_CONFIG_DEFAULT_DCDCEN.

    To verify that the DCDC is enabled, you can read the DCDCEN register using nrfjprog:

    nrfjprog --memrd 0x40000578

    and it should say 0x00000001 if it is enabled, and 0x00000000 if it is disabled. 

    Hope that helps. Let me know if you are stuck.

    Best regards,

    Edvin

  • no. NRFX is the new drivers. Keep them. You can remove the old ones if you like.

    The apply_old_config.h is located in SDK17.1.0\integration\nrfx\legacy\apply_old_config.h

    Yes. If you have enabled the softdevice, you can use sd_power_dcdc_mode_set(), if not, you can use the nrf_drv_power_init(NULL),

    Best regards,

    Edvin

  • I am using SDK17 and nrf52810 custom board. I tried to manage enable DCDC Regulator. For this, i removed old version config sentences, i changed the sdk_config.h :

    // <e> NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver
    //==========================================================
    #ifndef NRFX_POWER_ENABLED
    #define NRFX_POWER_ENABLED 1
    #endif
    // <o> NRFX_POWER_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    // <0=> 0 (highest)
    // <1=> 1
    // <2=> 2
    // <3=> 3
    // <4=> 4
    // <5=> 5
    // <6=> 6
    // <7=> 7

    #ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY
    #define NRFX_POWER_CONFIG_IRQ_PRIORITY 6
    #endif

    // <q> NRFX_POWER_CONFIG_DEFAULT_DCDCEN  - The default configuration of main DCDC regulator
     

    // <i> This settings means only that components for DCDC regulator are installed and it can be enabled.

    #ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN
    #define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 1
    #endif

    // <q> NRFX_POWER_CONFIG_DEFAULT_DCDCENHV  - The default configuration of High Voltage DCDC regulator
     

    // <i> This settings means only that components for DCDC regulator are installed and it can be enabled.

    #ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV
    #define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0
    #endif

    // </e>


    end then i call this function respectively. is there any wrong thing in enable process?

    ret_code_t err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);

    err_code = nrfx_drv_power_init(NULL);
    APP_ERROR_CHECK(err_code);

    err_code = sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); APP_ERROR_CHECK(err_code);

    err_code  = nrf_sdh_ble_enable(&ram_start);
    APP_ERROR_CHECK(err_code);  

     

  • Don't know. Does it work? Do any of the APP_ERROR_CHECK() return an err_code != 0? Does the register change?

    What are you running the application on? The nRF52832DK, or an actual nRF52810?

    Best regards,

    Edvin

  • I am running on the nrf52810 custom own board. I did everything that you advised me and then i read register and i see register value equals to 1. but power profiler says 0.027ua average current but i see 0.035 ua. i am confused. should i call? nrf_power_init with sd_dcdc_mode_set function?

  • You only need one of them. If the register reads 0x00000001, then DCDC is enabled. 

    Oguzhann said:
    power profiler says 0.027ua average current but i see 0.035 ua.

    What do you mean? Can you please share a screenshot?

Reply Children
  •  https://devzone.nordicsemi.com/power/w/opp/2/online-power-profiler-for-bluetooth-le

    i
    n this tool, i configured all parameters as i use. but when i measure the current, there is difference. so that i confused what can i do for this differences? i have a suspect about did i enable dcdcen?

    Current consumption
    BLE event total charge 11.67 µC
    Idle current 1.1 µA
    Total average current 27 µA



  • It is perfectly possible to have enabled DCDC and still use a lot more current. Did you actually measure the current using a PPK? If so, can you show me a screenshot of what it looks like?

    In addition, anything else you do in your application will affect the power consumption. The numbers from the online power profiler only includes what is needed for the BLE to work. 

  • i am kust using UNI-T multimeter. i read the current from uart on usb port. thank you sir. it is wonderful to heard dcdc is working.

  • #ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN
    #define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0
    #endif
     
    if this is stay as 0, the dcdc register is 1. is this reason this (above) just define default regulator option?
  • Oguzhann said:
    i read the current from uart on usb port.

    Not sure what that means. 

    But if you just measure the current going into the nRF using a normal multimeter, that may not be very accurate. They are not always good at reading these kind of current consumptions, where you will have close to 0A most of the time, but then you will have short spikes when the radio is being used. Not all multimeters are good at interpreting these. Some will not catch the spikes at all, while some will think that the spikes are much longer (in time). They will read out the maximum current for a given period, and assume that this was the current consumption for that sample length. Therefore, you must use something like the power profiler kit II to accurately measure the current.

    Oguzhann said:
    if this is stay as 0, the dcdc register is 1. is this reason this (above) just define default regulator option?

    If you call sd_dcdc_mode_set() nrf_power_init() with the correct parameters, it will enable the DCDC regardless of whether the NRFX_POWER_CONFIG_DEFAULT_DCDCEN is set to. That is just a definition, so it doesn't magically change anything, unless it is actively used. 

    BR,

    Edvin

Related