I am using STM32F103C8Tx and I am trying to create a PID adjustable PWM. In PID I will be giving values to PWM from 0 to 100 to set the duty cycle. That means my counter period needs to be 100 in Cubemx. Because as I have learnt while I am changing the dutch cycle it changes the counter period. However, I need to create PWM with 200 KHz frequency and the clock of the timer is 72 MHz.In order to achieve a value of 100 in counter period I need to have a 3.6 prescaler. Am I following a wrong way or did I get this PWM duty cycle thing wrong in stm32?
Note: I am using htimx.Instance->CCRx =Duty_Cycle;
in order to change the duty cycle from code.
Which means my counter period needs to be at least 100
One percent is 1/100 part of a "whole". It doesn't mean that the "whole" needs to be exactly 100. Can't you set it to for example 18000? – KamilCuk