cancel
Showing results for 
Search instead for 
Did you mean: 

Sleep Mode

serdar118
Associate II
Posted on October 05, 2009 at 16:41

Sleep Mode

5 REPLIES 5
serdar118
Associate II
Posted on May 17, 2011 at 13:24

Hi!

I am using stm32f103rd for our project. I have to put the microcontroller to sleep for power saving...

I have two problems. First problem is when i use sleep mode(WFI-WFE) the independent watchdog continues to run. It causes microcontroller to reset itself continuously. In sleep mode how can i reload watchdog counter?

Second problem is i have to wake the microcontroller on any usart receive interrupt. I have usart2 receive interrupt but it doesnot wake the system. Does not the usart receive wake the microcontroller ?

Am i missing something?

Thanks for helping

serdar118
Associate II
Posted on May 17, 2011 at 13:24

No answer?

Dont anybody use sleep mode?

mohith
Associate II
Posted on May 17, 2011 at 13:24

WWDG - You can simply disable this module WWDG_Enable(DISABLE), and enable it back after waking up

Wake on interrupt - If you have the interrupts enabled and the NVIC initialized for the interrupt channel, you should be able to wake on any interrupt. This is what I did (though I never got time to test it)

Code:

SCB->SCR &= ~(SCB_SCR_SLEEPONEXIT | SCB_SCR_SLEEPDEEP);

SCB->SCR |= SCB_SCR_SLEEPONEXIT;

__WFI();

Might I advice privileged mode.. modification of M3 core SCB register needs it.

good luck

serdar118
Associate II
Posted on May 17, 2011 at 13:24

Actually i am using independent watchdog not the window watchdog. I will try your code in a moment i will reply if it works?

P.S. Watchdog problem is still unsolved.

tomas23
Associate II
Posted on May 17, 2011 at 13:24

Clearly, independent watchdog is a security feature, so it MUST NOT be possible to block it because of LP mode. Use some periodic interrupt (RTC alarm, timers with long prescaler etc.) to wake up the system periodically and refresh the IWDG.