VN21 (Video No:21) This video is about, (Hal lib V2.11.0) while working with STM32CubeMX and STM32F4 discovery board, how to do Timer processes? What are PWM mode, Fast PWM and how to use them?
<<Video>> | Watch |
<<Source Code>> | Download |
Notes;
- At first, determine PWM resolution in the PWM processes such as 100 steps, 200 steps, 300 steps.
- Determine PWM frequency such as 50Hz, 1kHz, 4kHz.
- Counter register (ARR) value is taken same as the value of PWM resolution.
- Required Duty cycle is obtained with Pulse value.
- Fast PWM mode has twice higher frequency than normal PWM mode.
- TIM_clk = APBx_TIM_clk / (Prescaler+1)
- TIM_freq = TIM_clk / (ARR+1)
- Duty_cycle(%) = (CCRx / ARR)x100