General questions on timers.
Hello,
I'm still learning how to handle timers in CubeMx. I've got some simple questions.
I'm using TIM1 and TIM2 of the L432KC. In the clock tree, I see APB1/APB2 peripheral and timer clocks bus frequencies. I thought that when I set a prescaler, the APBx timer clock frequency is the one divided by the prescaler, but actually is the APBx peripheral clock frequency. What's the real difference?
Second question:
I've set timer 2 in PWM input to measure the period of an input signal. So,
.....
period = HAL_TIM_ReadCapturedValue(&htim1, TIM_CHANNEL_2);
....
Does this say the period in milliseconds, right?
Third question:
I read in an app note:
The TIMxCLK frequency is set to 72 MHz, the prescaler is 0x0 so the TIM2 counter clock frequency is 72 MHz. So the minimum frequency value to measure is 1100 Hz.
How do I calculate that minimun frequency?
Last question:
When setting the PWM input mode or input capture mode to measure an external signal, how do I choose the prescaler and counter period effectively in CubeMx according to my frequencies range?
