How many things do you need to control, and where are they attached to the PIC?
If they're attached to CCP1 or CCP2 (look at the pin diagram in the 16F877A datasheet), then you can use the hardware PWM routines. There is an example of how to do this on an '877A at http://gcbasic.sourceforge.net/help/hpwm.htm
hi,
Could someone send some examples program for controlling PWM (especially for PIC16F877A).
How many things do you need to control, and where are they attached to the PIC?
If they're attached to CCP1 or CCP2 (look at the pin diagram in the 16F877A datasheet), then you can use the hardware PWM routines. There is an example of how to do this on an '877A at http://gcbasic.sourceforge.net/help/hpwm.htm
If they're attached somewhere else, you'll need to use software PWM. An example for this is at http://gcbasic.sourceforge.net/help/pwmout.htm