Skip to main content
davidle.ee9
Associate II
April 6, 2019
Question

Please share or let me know what is the best solution for a long timer ( 2 to 4 Hours) interrupt example(s)

  • April 6, 2019
  • 4 replies
  • 959 views

I want to set up the interrupt for system power off the main MCU, the STM32L4 xx .

As soon it is powered on, then starting the timer to turn it off after 2- to- 4 Hours.

Please point me how to implement it since I'm still new for STM32L4xx

This topic has been closed for replies.

4 replies

S.Ma
Principal
April 7, 2019

You probably have to look at RTC with alarms as the duration required here is quite long.

Otherwise, use the LPTIM which should have its own clock local source

davidle.ee9
Associate II
April 7, 2019

Thanks

But I'm in using its internal RC as the system clock (no external X-tal )

Could it be OK for your idea?

S.Ma
Principal
April 7, 2019

On stm32l4 most peripherals can run with their own chosen clock source... For optimum power saving. Checkout the LPTIMER

Peter Mather
Associate III
April 7, 2019

the 32-bit Timer2 with a 16-bit prescaler set will easily meet your requirement