cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, how make stm8s103 sleep for 15 minutes and auto wakeup do some thing and sleep again. Repeat this all the time. Thanks

carlossp
Associate II
 
18 REPLIES 18
Krashoup
Associate

I'm not an expert with the STM8 cards but I think you could have a look at the Timers on the board (16 bit ones) and their interrupts. You could setup the timer, enter in low power mode, and wake up from the low power mode when the interrupt is triggered.

I assume that you could prescale the clock of the timer low enough to obtain a 15 minutes countdown but it might have precision issues depending on the input clock.

For newer designs perhaps consider parts with an RTC

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Peter BENSCH
ST Employee

...e.g. the STM32C011F4, whose family was recently launched as the successor to the STM8S already set on NRND. Its RTC can easily be programmed to wake up every 15 minutes, which has already been discussed here in the community several times.

Good luck!

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi, Krashoup

Your solution is good but it is only possible with the "wait mode" that has a minimum consumption more than double of the "active halt mode" that is my desired mode, if possible.

Anyway, your sugested solution will be tested against others.

Thank you for your answer.

Hi, Tesla DeLorean

Yes, in the future, for this kind of project a RTC will be very helpfull, but at this momente I only have a bunch of STM8S103 that I want to use.

Thank you for your answer

Hi, Peter BENSCH

Very good to know about the STM32C011F4.

I will definitely review it for my future projects.

Thanks for your response.

carlossp
Associate II

I think the better solution at this moment is enter in "active halt mode" with a AWU time of 30 seconds and repeat the AWU interrupts 30 times before do anything.

I will wait a little more to see if is there another better solution.

Thank you everyboddy.

Your slowest clock and largest divider/prescaler will determine the maximum length of time between waking cycles. You'll then need to mark off time in those units.

I know you have parts, but if this is a more commercial design the long-term availability is questionable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Right, for the "active halt mode" the maximum lenght of time, according with the Reference Manual RM0016 page 116 Table 25, is only 30.720s so if I choose this solution I have to wait 30 AWU interrupts to perform 15 minutes.

At this moment this is only a experimental project.

Thank you.