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

Current consumption

Hi, 

I tried to monitor current consumption of my device. I used

 

sd_app_evt_wait();

and then used 

 // Wait for an event.
        __WFE();
        // Clear the internal event register.
        __SEV();
        __WFE();

I saw something like this

There are spikes on everywhere.

If I comment out sd_app_evt_wait(); or last __WFE(); it beacomes like that

I am using sdk 15.0.0, before this I was using sdk 14.2 and in 14.2 I was using sd_app_evt_wait function and there was no spikes. How can I fix it?

Thanks.

Parents
  • Have you tried stepping through your code when debugging in order to see what exactly happens here? You should set a breakpoint just before stateMachineRun() and make sure sd_app_evt_wait() ever gets there, and what happens after. I have a suspicion, that either sd_app_evt_wait() is never reached, or that sd_app_evt_wait() doesn't last very long, as it really just waits for an event as well.

    Best regards,

    Simon

  •   stateMachineRun();
        SEGGER_RTT_printf(0,"?");
        sd_app_evt_wait();
        SEGGER_RTT_printf(0,".");

    I added this to see sd_app_evt_wait() is reached or not and result is like that 

      

    Red areas happen when 2.4 seconds completed, so program is running as expected. Also sd_app_evt_wait() is working, it decreases current consumption 12 mAh to 6 mAh, only those spikes appear. 

Reply
  •   stateMachineRun();
        SEGGER_RTT_printf(0,"?");
        sd_app_evt_wait();
        SEGGER_RTT_printf(0,".");

    I added this to see sd_app_evt_wait() is reached or not and result is like that 

      

    Red areas happen when 2.4 seconds completed, so program is running as expected. Also sd_app_evt_wait() is working, it decreases current consumption 12 mAh to 6 mAh, only those spikes appear. 

Children
No Data
Related