How to use IO pins in PIC microcontroller as PWM?
The delay() function causes the PIC to loop and prevents any other activity other than interrupt triggered routines. In your example it will turn on RA0 for 10 ms, pause (preventing servicing any other output) and then turn off RA0 for 10 ms with the same inhibiting action. The pause() function should really be hidden from beginners as it encourages this kind of poor programming practice.

Instead you should run a base timer for your PWM outputs and do something like this pseudo code.

while(1) {
  timer += 1;                // increment the timer.
  if (timer &gt; tmax) {
    timer = 0;               // reset
  }
  PORTA.RA0 = (timer &lt; t0ontime);  // Output on until ontime exceeded.
  PORTA.RA1 = (timer &lt; t1ontime);
  PORTA.RA2 = (timer &lt; t2ontime);
  PORTA.RA3 = (timer &lt; t3ontime);
  PORTA.RA4 = (timer &lt; t4ontime);
  PORTA.RA5 = (timer &lt; t5ontime);
  PORTA.RA6 = (timer &lt; t6ontime);
  PORTA.RA7 = (timer &lt; t7ontime);
}


It's been many years since I've used the PIC compiler so this may not work as written, but you get the idea. You should make the timer increment on a fixed timebase rather than the way I've shown it so that it won't vary if you change the chip oscillator, etc.

One other improvement you could make on this code is to avoid starting all the pulses at the same time. This would smooth out the demand on the power supply and may help reduce noise a little.