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

cpu idle and sd_app_event_wait in NRF51

hi,

According to nRF51_reference_manual doc and Relate Discuss. I think that power mode have system on(run/idle) and system off and at system on idle(sleep) mode which contain Constant Latency and Low Power(default).

how to select the system on idle mode is Constant Latency or Low Power? automatically select depending on peripheral ?or how much power is needed .? when i save power ,so we should be into idle mode? in the idle mode the power how to Calculate? (spi' rtc(app timer)'pwm(gpiote)..at adversting modle and connect mode.)

when idle mode the current should be Ion+Irtc+Ix32 about 5uA. right? In this mode should need softdevice or other setting? why i Measure 4mA.


int main(void)
{
    // Initialize
   int i=0;
    for (;;)
    {
        //app_sched_execute();
        power_manage();
    }
}

/**@brief Function for the Power manager.
 */
static void power_manage(void)
{
	uint32_t err_code;
	uint8_t softdevice_enabled;
	err_code=sd_softdevice_is_enabled(&softdevice_enabled);
	if(softdevice_enabled)
	{		
    err_code = sd_app_event_wait();
    APP_ERROR_CHECK(err_code);
	}
	else
	{
		__WFE();  
    __SEV();
    __WFE();
	}
}

run ble sample , and set long ADVERTISING interval time 1s. It should be at idle mode . that get 210uA.


int main(void)
{
    // Initialize
    leds_init();
    timers_init();
    gpiote_init();
    buttons_init();
    ble_stack_init();
    scheduler_init();
    gap_params_init();
    advertising_init();
    services_init();
    conn_params_init();
    sec_params_init();
    
    // Start execution
    timers_start();
    advertising_start();
    
    // Enter main loop
    for (;;)
    {
        app_sched_execute();
        power_manage();
        nrf_gpio_pin_toggle(ADVERTISING_LED_PIN_NO);
    }
}



ble_app_template.zip

Related