RTC Running in System ON Mode Current Consumption?

hi,

i am using nrf connect extension in vs code with Zephyr os version v3.2.99-ncs2 , 

when device in system on sleep how much current consume by nrf52833 development kit ? when only RTC Being on.

1. during sleep, RTC  current consumption?

2. what is complete current consumption flow(rtc,idle thread and LFRC) during system on sleep? 

pm_state_force(0u, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0}); //nrfonly switch 

  • hi,

    Is there an option for the device to be in SYSTEM_OFF sleep for any of this duration? Will the device be receiving an external interrupt at any point that could have been used to wake the device from SYSTEM_OFF sleep, for instance?

    System off sleep is not possible because device is independent . only software based interrupt can be feasible.

    This will depend on what other peripherals and processes you have got going in your application - you will need to disable all peripherals(except the RTC) and radio activity, and then lastly turn off the ram as well.
    You can read about how to configure the RAM retention during SYSTEM_ON and SYSTEM_OFF here.

    system on + rtc+ lfrc + no ram retention only. ble gets on advertise-sleep-repeat. now could you provide any example code to achieve this?

  • Hello again,

    starkAbhi said:
    System off sleep is not possible because device is independent . only software based interrupt can be feasible.

    Thank you for clarifying.

    starkAbhi said:
    system on + rtc+ lfrc + no ram retention only. ble gets on advertise-sleep-repeat. now could you provide any example code to achieve this?

    We do unfortunately not have any examples that match this description already, but it should not take you so long to set this up yourself. I would suggest that you start out with one of the minimal BLE example, such as the Multiple Advertising Sets sample, trim away the extra advertising sets, and implement the go-to-sleep and wake-from-sleep procedures (turning off/on peripherals and RAM, etc.).

    Give this a try, and let me know if you encounter any issues or questions along the way :) 

    If you are not yet familiar with the nRF Connect SDK then I would highly recommend taking a look through the DevAcademy Fundementals course to quickly familiarize with the SDK.

    Best regards,
    Karl

  • hi,

    We do unfortunately not have any examples that match this description already, but it should not take you so long to set this up yourself. I would suggest that you start out with one of the minimal BLE example, such as the Multiple Advertising Sets sample, trim away the extra advertising sets, and implement the go-to-sleep and wake-from-sleep procedures (turning off/on peripherals and RAM, etc.).

    i have some experience with nrf connect vscode sdk. i need only some guidance on API to put device in sleep to minimize sleep current near to 1.6uA or less.

    below code i used to advertise-sleep-periodically.

    //advertiser sleep
    
    #include <zephyr/types.h>
    #include <stddef.h>
    #include <zephyr/sys/util.h>
    #include <zephyr/bluetooth/bluetooth.h>
    #include <zephyr/bluetooth/hci.h>
    //---power management lib--
    #include <zephyr/pm/pm.h>
    #include <zephyr/pm/device.h>
    /////////////////////////////
    
    #define DEVICE_NAME CONFIG_BT_DEVICE_NAME
    #define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
    
    uint8_t vol_Per = 0; //voltage in % but hex converter it
    
    static uint8_t adv_data[] = {
    0x0f,0x18, //uuid battery service uuid[1],uuid[0] //0x180f: battery services
    0x10 //data: battery percentage hex to % 0x10 = 16%
    };
    
    static const struct bt_data ad[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_NO_BREDR),
    BT_DATA(BT_DATA_SVC_DATA16,adv_data,3),   
    };
    
    /* Set Name adv data */
    static const struct bt_data sd[] = {
    BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
    };
    
    static void bt_ready(int err) {
    	char addr_s[BT_ADDR_LE_STR_LEN];
    	bt_addr_le_t addr = {0};
    	size_t count = 1;
    	/* Start advertising */
    	bt_le_adv_start(BT_LE_ADV_NCONN_IDENTITY, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
    
    	bt_id_get(&addr, &count);
    	bt_addr_le_to_str(&addr, addr_s, sizeof(addr_s));
    	// printk("Beacon started, advertising as %s\n", addr_s);
    }
    
    void main(void) {
    /* Initialize the Bluetooth Subsystem */
    bt_enable(NULL);
    while(1) {
    bt_ready(0); //advertising
    /* Update advertising */
    //// -------simulating voltage increasing gradually-----------
    // vol_Per++;
    // adv_data[2] = vol_Per;
    // if (vol_Per > 64) {
    // vol_Per = 0;
    // }
    // k_sleep(K_SECONDS(1)); //1 second
    // //////////////////////////////////////////////////////
    // bt_le_adv_update_data(ad, ARRAY_SIZE(ad),sd, ARRAY_SIZE(sd));
    
    k_sleep(K_SECONDS(1)); //WAIT time
    bt_le_adv_stop();
    pm_state_force(0u, &(struct pm_state_info){PM_STATE_SUSPEND_TO_IDLE, 0, 0}); //nrfonly switch: 2.2 uA 
    k_sleep(K_SECONDS(3)); //update time
    } //end of while
    }//end of main
    

    thanks for sharing , i already have seen it. 

  • Hello,

    starkAbhi said:
    thanks for sharing , i already have seen it. 

    I am glad to hear that! :) 

    Looking at the code you have shared you really should check the returned error codes from your SDK function calls - if you do not then you will have no way to know whether the call completed successfully or failed for whatever reason.

    You will also need to explicitly disable your RAM before going to sleep, which will require your to re-configure and initialize your application when you wake from sleep (because the contents of the RAM will be wiped).

    Best regards,
    Karl

  • Hi,

    My apologies for late reply, could you please suggest me code snippet or example to disable RAM. and enable it again. what is the most power efficient techniques to increase the battery life?

Related