AnsweredAssumed Answered

Power consumption without low power ...

Question asked by Legrand.Thomas.001 on Oct 17, 2012
Latest reply on Dec 15, 2012 by Clive One
Hello,

I'm using USB in my application so I cannot use any low power mode, not even __WFI().

I'm trying to understand what drives the power consumption of the MCU when using a while(1); loop in the main ... and can't find any logic conclusion.

For example, in my systick handler, I have this :

void SysTick_Handler(void)
{
    oal_task_poll();
    cdc_echo_task();
}

And I get 46mA all the time.

If I add the following code :

void SysTick_Handler(void)
{
    oal_task_poll();
    cdc_echo_task();
  
    static int minVal = 120000;
    static int i = 0;
  
    if(SysTick->VAL < minVal)
        minVal = SysTick->VAL;
    if(++i == 1000)
    {
        i = 0;
        //printf("Val = %d\n", minVal);
        minVal = 120000;
    }
  
}

Then consumption goes down to 23mA !!!!!

Sometimes changing from while(1); to while(1) __nop(); doubles up the power consumption, but not in all cases.

Are there any rules that govern this ?

Thomas.

Outcomes