2019-08-07 07:34 AM
Hi,
I've seen mentioned in a couple of places that it is possible to drive timers (other than LPTIM) using the LSE. I can't actually find much more than this though...
Can LSE be used to drive TIM2 on the STM32L053, for example? If so, how is it acheived please?
Thanks
2019-08-07 08:36 AM
I think I've found it, which is always the way. You search for hours... You ask a question on a forum... Then you find the answer yourself.
In the Option Register (OR) for the timer, there is a field called ETR_RMP. Writing "101" to ETR_RMP connects LSE to the ETR (external trigger) input of the timer.
Oh, I forgot, then you have to select ETR as the counter clock:
LL_TIM_SetClockSource(TIM2, LL_TIM_CLOCKSOURCE_EXT_MODE2);