Skip to main content
Visitor II
June 27, 2025
Solved

5 khz wake from stop mode

  • June 27, 2025
  • 2 replies
  • 381 views

I have an application in which I'm required to check the status of an accelerometer 5000 times per second but it's a battery powered device so I want to minimize power consumption. I'm using an STM32L053C8 on a custom board with an external LSE crystal but I think that this would be a problem with any STM32.

I've tried setting up LPTIM clocked from the LSE source to generate interrupts and then putting the MCU into stop mode. The problem is that you can only generate frequencies which are an integer fraction of the LSE frequency so 32768/6 = 5461 Hz which is too fast for my application. 32768/7 = 4681 Hz is too slow.

Using the RTC clocked by the LSE is even more restrictive. The best that I can see would be an integer fraction of 16384 Hz.

The regular timers TIM2, TIM6 etc don't work in stop mode.

Am I missing something ?

    This topic has been closed for replies.
    Best answer by TDK

    HSI16 can be kept on in stop mode by setting HSI16KERON.

    HSE can't be used, missed that.

     

    2 replies

    Super User
    June 27, 2025

    Clock LPTIM using HSI16 or HSE.

    MMora.6Author
    Visitor II
    June 27, 2025

    Is it possible to keep HSE or HSI running in stop mode ? I don't think so.

    Alternatively, is there another way to minimize power consumption ?

    TDKAnswer
    Super User
    June 27, 2025

    HSI16 can be kept on in stop mode by setting HSI16KERON.

    HSE can't be used, missed that.

     

    MMora.6Author
    Visitor II
    June 27, 2025

    Sadly this doesn't seem to work. It looks as though when configured this way LPTIM still stops upon entering stop mode. The data sheet says:

    "The low-power timer has an independent clock and is running also in Stop mode if it is clocked by LSE, LSI or an external clock."

    So not when clocked by HSI ?