cancel
Showing results for 
Search instead for 
Did you mean: 

Using LSE as timer source for TIM2, etc. STM32L053

nkatch
Associate II

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

1 REPLY 1
nkatch
Associate II

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);