cancel
Showing results for 
Search instead for 
Did you mean: 

5 khz wake from stop mode

MMora.6
Associate II

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

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

HSE can't be used, missed that.

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Super User

Clock LPTIM using HSI16 or HSE.

If you feel a post has answered your question, please click "Accept as Solution".

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 ?

TDK
Super User

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

HSE can't be used, missed that.

 

If you feel a post has answered your question, please click "Accept as Solution".

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 ?