Generated PWM resolution
Hi,
I am new to STM32 devices. I have a STM32F407 Discovery 1 board.
I wanted to generate a 1 KHZ signal with a 50% duty cycle.
The timer clock is configured to 84 MHZ

I am using TIM3 on channel 4. The prescaler is 210 and the counter period is 400 =>
84000000 / 210 / 400 is 1000 HZ

In my code I have the following:
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_4); // start PWM on TIM3 CH4 on PB1 pin
PWM_Duty = 200; // set duty cycle to 50%
__HAL_TIM_SetCompare(&htim3, TIM_CHANNEL_4, PWM_Duty); // set duty cycle of PWM pin, now PWM starts runningHere is what I am seeing on the scope:

As you can see the frequency is 992.9 HZ.
I am trying to understand the resolution and why it is not 1000 HZ?
Thanks for any info.
Brent
