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

Problem with low power delay when using APP_Timer

Hello,

at the moment we are trying to realize a low power delay with the usage of the APP_TIMER.

We need a low power delay over 10 seconds.

This is our attempt:

APP_TIMER_DEF(initTimer);
volatile bool run_init=false;

static void TimeoutInit(void * context)
{
    run_init=true;
}

static void lfclk_config(void)
{
    NRF_CLOCK->LFCLKSRC             = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK->EVENTS_LFCLKSTARTED  = 0;
    NRF_CLOCK->TASKS_LFCLKSTART     = 1;
    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0)
    {
        //Do nothing.
    }
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
}

static void timers_init(void)
{
    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);
}

int main(void)
{
    ret_code_t error_code;
    
    enable_DCDC();
    lfclk_config();
    log_init();
    timers_init();
    power_management_init();
    
    app_timer_create(&initTimer, APP_TIMER_MODE_SINGLE_SHOT,TimeoutInit);
    APP_ERROR_CHECK(error_code);
    app_timer_start(initTimer, APP_TIMER_TICKS(10000),NULL);
    APP_ERROR_CHECK(error_code);
    
    while(1)
    {
        if (run_init == true)
        {
            run_init = false;
            // DO ALL MY STUFF
            ...
        }
        idle_state_handle();
    }
}
            

Unfortunately, we still have about ~2mA during this 10 seconds of waiting.

We need to achieve ~300µA current draw during the delay.

Can anybody provide some help? What causes this high current draw during the delay?

Thank you very much in advance.

Best regards,

Michael

Parents Reply Children
No Data
Related