power consumption da14531

Hi,

I am using da14531 and able to broadcast the beacon messages along with sensor information.
Followed the examples and ran my program without any error.
Now I would like to check the power consumption. Using my power profile it is carrying 4.4mAh peak current and average 1.2mAh. 
It is too high, how to reduce the power consumption. Are there any suggestions to reduce the current use of unwanted calls?
Please do the needful.
Regards,
Lofna
  • Hi Lofna, 

    Thanks for your question. Can you please share a snapshot from the power profiler? 

    In addition, please check if the flash is in power down mode. 

    Best regards, 

    Panos

  • Hi Panos,

    Thanks for your response. Please find the snapshot.

    Regardsprofile

  • Hi Lofna, 

    Is the device boots from System-RAM or SPI FLash? In the case of the System-RAM is the debugger attached or not? 

    It seems that the chi is not sleeping. Is the extended sleep mode enabled in the SW? WHat about the SPI flash power down? 

    Best regards, 

    PM_Renesas

  • Hi Renesas Team,

    I deployed the code in to the SPI flash not in to RAM. Running the code independently.

    I defined as : "static const sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;"

    for your understanding find the below configuration code.

    Regards

    Lofna

    /**
     ****************************************************************************************
     *
     * @file user_periph_setup.c
     *
     * @brief Peripherals setup and initialization.
     *
     * Copyright (C) 2015-2019 Dialog Semiconductor.
     * This computer program includes Confidential, Proprietary Information
     * of Dialog Semiconductor. All Rights Reserved.
     *
     ****************************************************************************************
     */
    
    /*
     * INCLUDE FILES
     ****************************************************************************************
     */
    
    #include "user_periph_setup.h"
    #include "datasheet.h"
    #include "system_library.h"
    #include "rwip_config.h"
    #include "gpio.h"
    #include "uart.h"
    #include "syscntl.h"
    
    /*
     * GLOBAL VARIABLE DEFINITIONS
     ****************************************************************************************
     */
    
    /**
     ****************************************************************************************
     * @brief Each application reserves its own GPIOs here.
     ****************************************************************************************
     */
    
    #if DEVELOPMENT_DEBUG
    
    void GPIO_reservations(void)
    {
    /*
        i.e. to reserve P0_1 as Generic Purpose I/O:
        RESERVE_GPIO(DESCRIPTIVE_NAME, GPIO_PORT_0, GPIO_PIN_1, PID_GPIO);
    */
    
    #if defined (CFG_PRINTF_UART2)
        RESERVE_GPIO(UART2_TX, UART2_TX_PORT, UART2_TX_PIN, PID_UART2_TX);
    #endif
    
        RESERVE_GPIO(LED, GPIO_LED_PORT, GPIO_LED_PIN, PID_GPIO);
        RESERVE_GPIO(BUTTON, GPIO_BUTTON_PORT, GPIO_BUTTON_PIN, PID_GPIO);
    		RESERVE_GPIO(BUTTON_ACCEL, GPIO_ACCEL_PORT, GPIO_ACCEL_PIN, PID_GPIO);
    
    		RESERVE_GPIO(SDA, I2C_SDA_PORT, I2C_SDA_PIN, PID_I2C_SDA);
    		RESERVE_GPIO(SCL, I2C_SCL_PORT, I2C_SCL_PIN, PID_I2C_SCL);
    	
    	#if defined (CFG_SPI_FLASH_ENABLE) && !defined (__DA14586__)
        // SPI Flash
        RESERVE_GPIO(SPI_EN, SPI_EN_PORT, SPI_EN_PIN, PID_SPI_EN);
        RESERVE_GPIO(SPI_CLK, SPI_CLK_PORT, SPI_CLK_PIN, PID_SPI_CLK);
        RESERVE_GPIO(SPI_DO, SPI_DO_PORT, SPI_DO_PIN, PID_SPI_DO);
        RESERVE_GPIO(SPI_DI, SPI_DI_PORT, SPI_DI_PIN, PID_SPI_DI);
    #endif
    
    }
    
    #endif
    
    void set_pad_functions(void)
    {
    /*
        i.e. to set P0_1 as Generic purpose Output:
        GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_1, OUTPUT, PID_GPIO, false);
    */
    
    	
    #if defined (__DA14586__)
        // Disallow spontaneous DA14586 SPI Flash wake-up
        GPIO_ConfigurePin(GPIO_PORT_2, GPIO_PIN_3, OUTPUT, PID_GPIO, true);
    #else
        // Disallow spontaneous SPI Flash wake-up
        GPIO_ConfigurePin(SPI_EN_PORT, SPI_EN_PIN, OUTPUT, PID_SPI_EN, true);
    #endif
    
    #if defined (CFG_PRINTF_UART2)
        // Configure UART2 TX Pad
        GPIO_ConfigurePin(UART2_TX_PORT, UART2_TX_PIN, OUTPUT, PID_UART2_TX, false);
    #endif
    
        GPIO_ConfigurePin(GPIO_LED_PORT, GPIO_LED_PIN, OUTPUT, PID_GPIO, true);
        GPIO_ConfigurePin(GPIO_BUTTON_PORT, GPIO_BUTTON_PIN, INPUT_PULLUP, PID_GPIO, true);
        GPIO_ConfigurePin(GPIO_ACCEL_PORT, GPIO_ACCEL_PIN, INPUT_PULLUP, PID_GPIO, true);
    		
    		// Configure I2C pin functionality
        GPIO_ConfigurePin(I2C_SCL_PORT, I2C_SCL_PIN, INPUT_PULLUP, PID_I2C_SCL, false);
        GPIO_ConfigurePin(I2C_SDA_PORT, I2C_SDA_PIN, INPUT_PULLUP, PID_I2C_SDA, false);
    
    #if defined (CFG_SPI_FLASH_ENABLE)
        // SPI Flash
        GPIO_ConfigurePin(SPI_EN_PORT, SPI_EN_PIN, OUTPUT, PID_SPI_EN, true);
        GPIO_ConfigurePin(SPI_CLK_PORT, SPI_CLK_PIN, OUTPUT, PID_SPI_CLK, false);
        GPIO_ConfigurePin(SPI_DO_PORT, SPI_DO_PIN, OUTPUT, PID_SPI_DO, false);
        GPIO_ConfigurePin(SPI_DI_PORT, SPI_DI_PIN, INPUT, PID_SPI_DI, false);
    #endif
    
    }
    
    #if defined (CFG_PRINTF_UART2)
    // Configuration struct for UART2
    static const uart_cfg_t uart_cfg = {
        .baud_rate = UART2_BAUDRATE,
        .data_bits = UART2_DATABITS,
        .parity = UART2_PARITY,
        .stop_bits = UART2_STOPBITS,
        .auto_flow_control = UART2_AFCE,
        .use_fifo = UART2_FIFO,
        .tx_fifo_tr_lvl = UART2_TX_FIFO_LEVEL,
        .rx_fifo_tr_lvl = UART2_RX_FIFO_LEVEL,
        .intr_priority = 2,
    };
    #endif
    
    static const i2c_cfg_t i2c_cfg = {
        .clock_cfg.ss_hcnt = I2C_SS_SCL_HCNT_REG_RESET,
        .clock_cfg.ss_lcnt = I2C_SS_SCL_LCNT_REG_RESET,
        .clock_cfg.fs_hcnt = I2C_FS_SCL_HCNT_REG_RESET,
        .clock_cfg.fs_lcnt = I2C_FS_SCL_LCNT_REG_RESET,
        .restart_en = I2C_RESTART_ENABLE,
        .speed = I2C_SPEED_MODE,
        .mode = I2C_MODE_MASTER,
        .addr_mode = I2C_ADDRESS_MODE,
        .address = I2C_SLAVE_ADDRESS,
        .tx_fifo_level = 1,
        .rx_fifo_level = 1,
    };
    
    #if defined (CFG_SPI_FLASH_ENABLE)
        #include "spi.h"
        #include "spi_flash.h"
    #endif
    
    #if defined (CFG_SPI_FLASH_ENABLE)
        // Configuration struct for SPI
        static const spi_cfg_t spi_cfg = {
        .spi_ms = SPI_MS_MODE,
        .spi_cp = SPI_CP_MODE,
        .spi_speed = SPI_SPEED_MODE,
        .spi_wsz = SPI_WSZ,
        .spi_cs = SPI_CS,
        .cs_pad.port = SPI_EN_PORT,
        .cs_pad.pin = SPI_EN_PIN,
        #if defined (__DA14531__)
            .spi_capture = SPI_EDGE_CAPTURE,
        #endif
        };
    
        // Configuration struct for SPI FLASH
        static const spi_flash_cfg_t spi_flash_cfg = {
            .chip_size = SPI_FLASH_DEV_SIZE,
        };
    #endif
    
    void periph_init(void)
    {
    #if defined (__DA14531__)
        // Disable HW Reset functionality of P0_0
        GPIO_Disable_HW_Reset();
    	
    	// In Boost mode enable the DCDC converter to supply VBAT_HIGH for the used GPIOs
        syscntl_dcdc_turn_on_in_boost(SYSCNTL_DCDC_LEVEL_3V0);
    #else
        // Power up peripherals' power domain
        SetBits16(PMU_CTRL_REG, PERIPH_SLEEP, 0);
        while (!(GetWord16(SYS_STAT_REG) & PER_IS_UP));
        SetBits16(CLK_16M_REG, XTAL16_BIAS_SH_ENABLE, 1);
    #endif
    
        // ROM patch
        patch_func();
    
        // Initialize peripherals
    #if defined (CFG_PRINTF_UART2)
        // Initialize UART2
        uart_initialize(UART2, &uart_cfg);
    #endif
    
    		i2c_init(&i2c_cfg);
    
    #if defined (CFG_SPI_FLASH_ENABLE)
        // Configure SPI Flash environment
        spi_flash_configure_env(&spi_flash_cfg);
    
        // Initialize SPI
        spi_initialize(&spi_cfg);
    #endif	
    
        // Set pad functionality
        set_pad_functions();
    
        // Enable the pads
        GPIO_set_pad_latch_en(true);
    }
    

  • Hi Lofna, 

    static const sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;

    In order to enable extended sleep mode, the app_default_sleep_mode should be defined to ARCH_EXT_SLEEP_ON. 

    With the current configuration, the chip is working on active mode and so the consumption  is increased. 

    Regards, 

    PM_Renesas

  • Hi Renesas,

    Due to switch dependency (simple button code - Short & long press) working in debug RAM mode (When defined :ARCH_EXT_SLEEP_ON) working, But when the code flashed in to SPI mode it is not working after changed it to "ARCH_SLEEP_OFF" then  it is working. This is the dependency.

    I have posted the same in an earlier question and the RENESAS team told me to change the field. find the below old query:

    Gpio poll to find the button short and long press - Bluetooth Low Energy - Wireless Connectivity - RenesasRulz

    Please recommend what I should follow?

    Regards,

    Lofna

  • Hi Lofna,

    As mentioned in the last comment in the thread you linked

    "The reason why the short and long button press example is not working with the extended sleep mode is that during sleep, peripherals such as UART, GPIOs etc. are turned off. This also means that during sleep the GPIO interrupt setup is deleted therefore the GPIO interrupt callback is never triggered.

    In order to use the button with extended sleep mode you can use the wake-up controller to wake up the device from sleep"

    So in order to have both low power consumption (extended sleep mode) and the button functionality you will need to modify your user code to use the wake-up controller. An example of the usage of the wake-up controller as mentioned in the previous thread:

    "An example for this can be found in the ble_app_sleepmode example of the SDK6

    …\6.0.16.1144\projects\target_apps\ble_examples\ble_app_sleepmode

    Navigating to file user_sleepmode.c, function app_button_enable you can see how the wakeup-controller functions are used:

    1. Function wkupct_register_callback registers a callback function(app_wakeup_cb) to handle the wake-up controller interrupt.
    2. Function wkupct_enable_irq enables the wake-up controller to catch an interrupt produced by the GPIO_BUTTON_PIN being set to 0 (which means that the button is pressed).

    When the button is pressed the wake-up controller interrupt is invoked and function app_button_press_cb is executed. This function will wake up the BLE and call another function to start advertising (app_wakeup_cb).

     You can use the ble_app_sleepmode example as a reference on how to use the wake-up controller."

    Please let us know if you have any follow-up questions.

    Best regards,
    AA_Renesas

  • Hi,

    Thanks for your response. Sure, I will go through the example and implement it in my code.

    Apart from this, are there any other power hungry related calls where I can save my battery.

    Regards,

    Lofna

  • Hi Lofna,

    This could depend on your application but the biggest difference in power consumption will be due to utilising one of the sleep modes or not. Please refer to the sleep modes tutorial for more information on the different sleep modes supported in the DA14531 and their corresponding power consumptions

    http://lpccs-docs.renesas.com/tutorial_da145xx_sleep_modes/index.html 

    In general when using extended sleep mode, the longer that the device is at sleep, the lower your power consumption will be. Using long advertising intervals(time between advertising events) will drop power consumption as the device will be at sleep for a larger part of the time. Also, optimising your user code to run as efficiently as possible will result in the device going to sleep faster thus saving power. 

    Best regards,
    AA_Renesas

  • Hi Renesas,
    My application is here ibeacon broadcasting (24x7) and these beacons are integrating with our gateway.
    Based on user configuration (At first boot only) we will load the beacon transmission interval (between 100ms to 1sec) settings. But it is continuously 24x7 broadcasting. 
    Will there be any challenge or problem with going into sleep mode when I call ARCH_EXT_SLEEP_ON.
     
    Regards,
    Lofna