i am working on a project of my own, making a RC CAR. I want to my motor to be controlled with PWM. I understand the basics of basics for PWM but still I get confused with calculation. What is the connection between PRx and OCxR, OCxR register, what does PRx register value do to duty cycle.
I have a motor that works on a 5-9V and frequency of 5-10MHz. My dspic has 10MHz oscillator input with PLL4. In datasheet the formula for PWM period is:
TOSC = 1/FOSC = 1/40MHz = 0.025us
PRx = 0
PWMperiod = (PRx+1) * 4 * TOSC *(TMRprescale 1:1) = 0.1us => PWMfreq = 1/PWMperiod = 10MHz.
That is how i get 10MHz pwm frequency.
If PRx is set to 0 what will happen to the pwm signal?