AnsweredAssumed Answered

LPtimer : modify register on the fly

Question asked by klem on Mar 24, 2016
Latest reply on Mar 28, 2016 by FTITI.Walid

I'm using the STM32L4 with the low power timer (LPTIM1).
I'm using it with the LSE clock in counter mode with IT (the counter count until reaching AutoReload value, then it goes into interruption ...).

I'd like to know if the AutoReload register can be modified on the fly ?

I tried to modify it inside the IRQ_handle and it seems to work (I can generate a PWM signal this way).
But when I modify it outside of the IRQ_handle (in my while(1) for example) it doesn't work.
When I stop my program in debug mode, I see AutoReload set to the good value and the counter exceeding AutoReload (instead of going into interruption).

Does anybody know if modifying the register on the fly is doable ?