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

Queries on Current measurement & how to reduce the same

Hello,

In addition to previous ticket I have further queries. I have a stringent requirement for reduction of Current consumption.

https://devzone.nordicsemi.com/support/230962

1) In ‘ble_app_blinky’ since SoftDevice is enabled, whether DCDC enabled by default or need to enabled explicitly by calling

                sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE) 

2) As mentioned below do I need to enable DC-DC only during BLE active and disable after BLE inactive.

https://devzone.nordicsemi.com/f/nordic-q-a/4211/nrf51822-power-consumption-when-ble-advertising-connected#post-id-18589

 

3) To my understanding, keeping build in “Release” mode will disable UART.

a) Below are the macros enabled in Release mode & Debug mode. But when I keep in “Release” mode still I am seeing debug prints on Terminal. Then what is the difference between “Release” & “Debug” builds.

"DEBUG; DEBUG_NRF" from solution in Debug configuration

"NDEBUG" from solution in Release configuration

b) As mentioned in below link, at the same time do I need to disable NRF_LOG_ENABLE explicitly do reduce current consumption. Please confirm.

                https://devzone.nordicsemi.com/f/nordic-q-a/35042/current-consumption-in-nrf52

 c) How to disable UART if still I am seeing debug prints on Terminal. Do I need to disable NRFX_UARTE_ENABLED macro or just disconnecting debug cable is good enough during current measurement.

 

4) Do I need to explicitly disable FPU unit. I have floating point calculations. But before going to sleep (System ON or System OFF) do I need to clear FPU as mentioned in below link.

                https://devzone.nordicsemi.com/f/nordic-q-a/15243/high-power-consumption-when-using-fpu

 

5) Before going to System OFF I called nrf_gpio_cfg_default() with all pins expect pin 13 & 14 (Buttons to wake-up the device). This function will configure pullup as NRF_GPIO_PIN_NOPULL. But as per below link, not sure with development kit whether do I need to change to Pullup or Pulldown.

https://devzone.nordicsemi.com/f/nordic-q-a/4505/system-power-off

 

Please let me know your inputs.

Thanks & Regards

Vishnu Beema

  • Hi Vishnu,

    1) In ‘ble_app_blinky’ since SoftDevice is enabled, whether DCDC enabled by default or need to enabled explicitly by calling

                    sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE) 

    The SDK example does not enable the DC/DC by default, so you should call sd_power_dcdc_mode_set() once during startup (after enabling the SoftDevice).

    2) As mentioned below do I need to enable DC-DC only during BLE active and disable after BLE inactive.

    https://devzone.nordicsemi.com/f/nordic-q-a/4211/nrf51822-power-consumption-when-ble-advertising-connected#post-id-18589

    This old post refers to nRF51. The nRF52 has full automatic control of the DC/DC, so there is never any reason to disable it. Just enable it at startup and forget about it.

    3) To my understanding, keeping build in “Release” mode will disable UART.

     No. That is not the case with the SDK examples. Logging is configured and enabled/disabled in the projects sdk_config.h.

    a) Below are the macros enabled in Release mode & Debug mode. But when I keep in “Release” mode still I am seeing debug prints on Terminal. Then what is the difference between “Release” & “Debug” builds.

    "DEBUG; DEBUG_NRF" from solution in Debug configuration

    "NDEBUG" from solution in Release configuration

    Release builds are built with optimization, and some logging that causes increased flash usage is disabled. Debug builds, on the other hand, is built with:

    • No optimization to simplify debugging
    • More debug information, that causes increased application size, but eases debugging (such as file name and line number information for all APP_ERROR_CHECK's).

    So to get low power consumption and high performance you should select "Release", but you also need to disable logging in sdk_config.h by setting NRF_LOG_ENABLED to 0.

    b) As mentioned in below link, at the same time do I need to disable NRF_LOG_ENABLE explicitly do reduce current consumption. Please confirm.

                    https://devzone.nordicsemi.com/f/nordic-q-a/35042/current-consumption-in-nrf52

    Yes.

     c) How to disable UART if still I am seeing debug prints on Terminal. Do I need to disable NRFX_UARTE_ENABLED macro or just disconnecting debug cable is good enough during current measurement.

    Assuming you only use UART via the logger module, then it is enough to set NRF_LOG_ENABLE to 0.

    4) Do I need to explicitly disable FPU unit. I have floating point calculations. But before going to sleep (System ON or System OFF) do I need to clear FPU as mentioned in below link.

    If (and only if) you use the FPU, you need to make sure to clear FPU interrupts before going to sleep. If you use the Power Management library, this can be done by simply setting NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED to 1 in your projects sdk_config.h. If not, then you need to do the same thing yourself before entering sleep (please refer to the implementation of pwr_mgmt_fpu_sleep_prepare() in components\libraries\pwr_mgmt\nrf_pwr_mgmt.c in that case).

    5) Before going to System OFF I called nrf_gpio_cfg_default() with all pins expect pin 13 & 14 (Buttons to wake-up the device). This function will configure pullup as NRF_GPIO_PIN_NOPULL. But as per below link, not sure with development kit whether do I need to change to Pullup or Pulldown.

    Since you call nrf_gpio_cfg_default() you set the pins as disconnected inputs, so the signal is not propagated further. Therefore there is no need for a pull resistor (the pin value doe snot mater anyway, even a floating pin is OK when it is disconnected and not used as an input signal).

    Br,

    Einar 

  • Hello,

     

    Thank you for your inputs. I have further queries.

     

    1) To my understanding, as part of Development kit Current measurement procedure, it’s only the current consumed by chip but not entire board. So even if chip control LED or any external sensor over TWI it will not measure entire current consumed. Please correct if I am wrong.

    a) But assume for my custom board if I want to measure entire current consumed by board (rather than just chip) then even pull-up in circuit will have some leakage currents even though nrf_gpio_cfg_default() is called.

     

    2) What should be the default pin configuration (input / output, pullup  / pulldown) if there are unused pins.

    3) After TWI operations I am calling nrf_drv_twi_disable(). But before going to deep sleep I want to configure SDA and SCL to proper state. So do I need to call explicitly nrf_gpio_cfg_default() or nrf_drv_twi_disable() is good enough.

    4) Similarly even for UART (Used for debug prints in ble_app_blinky), I am calling nrfx_uarte_uninit() which intern configure GPIO pins using pins_to_default(). In this function all are configured to input by calling nrf_gpio_cfg_default(). But as per table "Table 81:" in Product Specification, I am seeing RXD & CTS as Input and RTS & TXD as Output. Is this fine. If not then it is a bug in code. Please correct me.

    5) To my understanding, Low Power mode is set. If not do I need to call explicitly.

    sd_power_mode_set(NRF_POWER_MODE_LOWPWR);

     

    6) Whether do I need to configure unused pins as inputs or outputs. How about other settings with respect to unused pins so that Current consumption will not impact.

     

    7)  What is the default BLE Tx power output. Do I need to explicitly call sd_ble_gap_tx_power_set(0);

    8) Even if debug prints are enabled in “Release” mode, then what is the purpose of “NDEBUG” and “DEBUG; DEBUG_NRF”. Is this only for assertion validation.

    9) Whether can I use 1 ohm resistor rather than 10 ohm resister so that instead of dividing Voltage by 10 (V/10) to get current, I can consider Voltage directly as current.

      

    10) Whether current at 0.3 micro Amp (System OFF) & 2 micro Amp (System ON) be measured using Power Analyzer N6705B.

     

    Thanks & Regards

    Vishnu Beema

  • Hi Vishnu

    Einar is on summer vacation, so I've been tasked with this case in his stead.

    1. If the chip uses the TWI peripheral, uses the radio, or toggles an LED, that is accounted for when measuring the current consumption using a Power Profiler Kit. What is meant by the chip, and not the entire board, is that the debugger, etc. won't be calculated when using the Power Profiler Kit.

    This means it will measure the same* current for both your custom chip and the development kit. *Usually the DK will draw a bit more current than an optimized custom chip, as the DK will have some leakage current.

    2. Unused pins should not be defined at all, either connect them to ground or leave them floating.

    3. Disabling the TWI will be enough to go to deep sleep. The chip will not let current through while asleep.

    4. The call to nrf_gpio_cfg_default() configures the GPIO to the default state, which is disconnected input. This means that the nrfx_uarte_uninit function disconnects the pins so that they won't use the UART while UART is disabled. This is why you don't have to call these pin configuring functions yourself when disabling a peripheral. The initializing functions will reinitialize the pins to their correct states when the chip wakes up.

    5. You do not need to call this function explicitly. When you're going to sleep the SoftDevice will do that for you.

    6. No, you don't. See question 2.

    7. The default TX power output is 0dBm.

    8. These functions are there for debugging purposes. For example, if DEBUG_NRF is set it will set a software breakpoint just before the call to a hard fault.

    9. What resistor are you referring to here? Please be more specific.

    10. It is not done on one single device, it is the average across several current measurement tools.

    Best regards,

    Simon

  • Hello,

    Thank you for your inputs. I have further queries.

    1.a) Assume if I want to measure Current consumption for entire Development kit rather than just Nordic chip, how to do. Any changes to be done on Development kit without using Power Profile kit.

    2.a) For unused pins whether can I call pins using pins_to_default().

    4.a) I am trying to understand below statement. If RTS and TXD to be configured as Output before going to System OFF mode, but pins_to_default() will configure RTS and TXD as inputs. Below statement and code is contradicting.

    “To secure correct signal levels on the pins by the UARTE when the system is in OFF mode, the pins must be

    configured in the GPIO peripheral as described in Table 81: GPIO configuration before enabling peripheral on page 337.”  

    9.a) In Development kit guide, I am referring Current measurement procedure using CRO.

    10.a) Please let me know the devices used to measure System OFF and System ON current. Using Power analyzer I am not able to measure.

    Thanks & Regards

    Vishnu Beema

     

  • Hi

    1. To do this you would have to measure the DK as an external board described in the PPK user guide.

    2. You can, of course, but it wouldn't be necessary as unused pins would be in the default state by default.

    4. I think you're misunderstanding that statement. When using the UART it needs RTS and TXD to be outputs to work. When the system goes to system OFF, you would disable the UART, wherein the pins are set to the default state, and won't draw power in system OFF.

    9. No, you can't use a 1Ohm resistor, that is not how that calculation will work. 

    10. You should be able to measure current using your power analyzer. Have you done what is stated in section 6.7.1 Preparing the development kit board, in the DK user guide? You could also use any other of the current measurement tools stated in the user guide.

    Best regards,

    Simon

Related