2017-04-17 10:54 AM
I am looking for the max and typical update times for the LPTIMx_CMP and LPTIMx_ARR registers on an STM32L4x. I don't see these listed in the reference manual anywhere. Additionally, are there any settings or device states that can effect the update times?
2017-04-18 09:34 AM
Hi
johnr
,There is no typical rate for updating LPTIMx_ARR and LPTIMx_ARR,but for sure there is maximum rate.
This maxim depends on the APB and LPTIM kernel clock frequency.Based on these 2 flags : ARROK flag and the CMPOK flag in the LPTIM_ISR register, which indicate when the write operation is completed to respectively the LPTIM_ARR register and the LPTIM_CMP register.ARROK is set by hardware to inform application that the APB bus write operation to the LPTIM_ARR register has been successfully completed. If so, a new one can be initiated.
CMPOK is set by hardware to inform application that the APB bus write operation to the LPTIM_CMP register has been successfully completed. If so, a new one can be initiated.
You should check the ARROk flag is set before any new update.
After a write to the LPTIM_ARR register or the LPTIM_CMP register, a new write operation to the same register can only be performed when the previous write operation is completed. Any successive write before respectively the ARROK flag or the CMPOK flag be set, will lead to unpredictable results.
You may refer to this application note
LPTIM low power TIMER, it may be helpful for you. (5.2 PWM generator in STOP2 mode section)You have also theLPTIM examples in the CubeL4 firmware package whichdescribes how to configure and use LPTIM to count pulses and there isauto-reload each time the counter reaches the maximum value.
STM32Cube_FW_L4_V1.7.0\Projects\STM32L476G_EVAL\Examples\LPTIM\LPTIM_PulseCounterHope this helps you.
Imen
2019-02-20 12:10 PM