2022-07-02 09:04 PM
I have read a book on stm32, and inside the timer topic, it is stated that a formula to determine the values to be loaded to generate interrupt at specified times which as below:
My question is does this formula applicable for all stm32 timers? and another question is, I could not find this formula in reference manual for model stm32L476RG. Could someone show me where to get this formula from official ST documentation?
Solved! Go to Solution.
2022-07-03 02:35 AM
The official source is the reference manual, in your case RM0351 "STM32L47xxx, STM32L48xxx, STM32L49xxx and STM32L4Axxx advanced Arm®-based 32-bit MCUs". The formula may not be stated explictely, but can be dervived from the texts, like
33.4.7 ... "The counter clock frequency CK_CNT is equal to f_CK_PSC / (PSC[15:0] + 1)."
33.3.2 Counting mode, see the diagrams.
hth
KnarfB
2022-07-03 01:22 AM
The TIM use N-1 values for the Prescaler and Period counters as these are the simplest to implement. ie simple comparator of last value so next clock rolls into Update / Zero load.
ie Period = 9, has 10 states, 0 .. 9, repeating
2022-07-03 02:35 AM
The official source is the reference manual, in your case RM0351 "STM32L47xxx, STM32L48xxx, STM32L49xxx and STM32L4Axxx advanced Arm®-based 32-bit MCUs". The formula may not be stated explictely, but can be dervived from the texts, like
33.4.7 ... "The counter clock frequency CK_CNT is equal to f_CK_PSC / (PSC[15:0] + 1)."
33.3.2 Counting mode, see the diagrams.
hth
KnarfB