If you're not married to the PIC16F886, there are newer MCUs that might be able to meet your goals. Assuming a 50% duty cycle is desired, let's look at all the available Functions found on various PICs that would be capable of generating a square wave output.
1 - Of course, CCP using the PWM function
2 - Some PICs offer separate PWM SFRs in addition to the CCP
3 - CLC: using the Flip Flop Mode, any timer could be fed into a CLC to generate PWM output
4 - Timers where the Interrupt Handler Toggles the output
5 - Numerically Controlled Oscillator (NCO)
6 - Signal Measurement Timer
7 - If you don't need all PWM outputs simultaneously, Peripheral Pin Select can change which pins output the PWM
There are probably at least 1 or 2 I'm missing, but the point is to think outside the CCP box. Some PICs have upwards of 4 CCP modules, some up to 4 CLC, some have as many as 10 Timers, short of the new PIC18FxxQ43, only 1 NCO is available. You may be able to mix and match to achieve your goals.
In addition to more Functions, newer PICs have more stable Internal Oscillators, Peripheral Pin Select, and are almost always way cheaper. You can use Microchip's Part Selector Guide (or whatever they call it) to find PICs that meet your needs:
https://www.microchip.com/ParamChart...branchID=30048
Bookmarks