Hi, Pooja,
Do you just ONE PWM signal to control stepper motor?
If you just need one PWM signal to control stepper motor, you can use 50% duty cycle PWM to control motor, the PWM signal can be from CTimer or PWM modules.
For example
Pulse rate(pps) PWM cycle time(ms), PWM duty cycle,
111 9 50%
179 5.58 50%
....................
1033 0.968, 50%
Assume that the PCLK is 10MHz, the match3 of CTimer controls the cycle time of PWM signal, the match0 control the PWM duty cycle, this is the list:
Pulse rate(pps) PWM cycle time(ms), PWM duty cycle, match3 register, match0 register
111 9.027 50% 90270 90270/2=24135
179 5.58 50% 55800 55800/2
....................
1033 0.968, 50% 9680 9880/2
From firmware, you have to generate interrupt for each PWM cycle, then in ISR, compute the updated match3 and match0 register value.
If you need two or more PWM signals to control stepper motor, you have to use PWM signal from PWM module, because there is timing requirement for the two PWM signals.
Hope it can help you
BR
XiangJun Rong