Skip to main content
carlossp
Associate II
February 24, 2023
Question

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

  • February 24, 2023
  • 18 replies
  • 8001 views

..

    This topic has been closed for replies.

    18 replies

    Krashoup
    Associate
    February 24, 2023

    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.

    carlossp
    carlosspAuthor
    Associate II
    February 24, 2023

    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.

    Tesla DeLorean
    Guru
    February 24, 2023

    For newer designs perhaps consider parts with an RTC

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    carlossp
    carlosspAuthor
    Associate II
    February 24, 2023

    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

    Peter BENSCH
    ST Technical Moderator
    February 24, 2023

    ...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.
    carlossp
    carlosspAuthor
    Associate II
    February 24, 2023

    Hi, Peter BENSCH

    Very good to know about the STM32C011F4.

    I will definitely review it for my future projects.

    Thanks for your response.

    carlossp
    carlosspAuthor
    Associate II
    February 24, 2023

    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.

    Tesla DeLorean
    Guru
    February 24, 2023

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    carlossp
    carlosspAuthor
    Associate II
    February 24, 2023

    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.