cancel
Showing results for 
Search instead for 
Did you mean: 

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

davidle.ee9
Associate II

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

4 REPLIES 4
S.Ma
Principal

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

Thanks

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

Could it be OK for your idea?

Peter Mather
Associate III

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

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