I need to use PIC16F877A to generate a PWM signal to control my motor driver--MD22(**broken link removed**, the RC servo mode of MD22 need a PWM signal which has PWM period of 20ms and duty cycle range from 1ms to 2ms.
I look for the frequency problem online regarding PIC16F877A, but it seems that the lowest PWM frequency I can get is about 488Hz.
How can I generate the PWM signal in this case?
Just use a slower xtal oscillator (32.768 kHz would work), or maybe an RC osc; read up on the different osc types (this is all explained in the PIC16F877A data sheet). The duty cycle pulse is no problem no matter what xtal you use. The Period=P is:
P=[(PR2+1)4(Tosc)(PSV)] where PSV=prescale value
Ex. If use a 32.768 kHz xtal, with PSV=1 then PR2+1=163.84 ->164
Period(actual) = 20.0195 mS, 0.002 % difference from 20 mS