Thank you for all your replies. I only have 6 months of experience with PIC18F4520 and I am not very experienced with PWM. I think I'll need to re-phrase my question. Therefore, my question is, how can I control 4 DC motors individually using PWM?
I have tried using simple delays to generate pulses for the different speeds but the delay time for the 1st pulse seems to overlap with the other pulses, causing unstable voltage and speed. This is the main reason why I dropped the idea of using delays of generating pulses.
Instead, I tried using PWM to vary the DC motors' speed. I was successful in controlling the DC motors by PWM but there is only 2 PWM ports, CCP1 and CCP2 when I need to control 4 DC motors individually.
Is it possible to control multiple DC motors using the SD21, which I have mentioned above? Or is there any other simpler method to do so with just PIC18F4520 itself?