Since there is just a timer and a comparator you can't just set something to invert the signal, if you're looking for a command like "Config PORTC.Inverted" but if you understand how the PWM module works this is easily accomplished. Looking at the datasheet it works like this:
It's actually a little circuit that's in the MCU, this isn't just a flow chart of a program, it's physically in there.
As you can see the comparator checks the timer against the duty cycle, which is set in CCPRxL (and used from CCPRxH, but that's a buffer, you don't write to it) when timer exceeds this value it switches from high to low, so that determines the time the output is high. To make the whole process repeat the timer resets when TMR2 reaches the value in PR2, so PR2 sets the period. If you want to control the low time, since you can only set CCPR, just set it to the period (total time, low + high) minus the time you want it to be low.
This website with a PWM calculator actually does this. They set the first, CCPR1L, to the value for their pulse width, dc, and they set the second one CCPR2L for 128 (which is close to what they set PR2 to) minus dc.
https://www.micro-examples.com/public/microex-navig/doc/097-pwm-calculator.html
Code:
void main()
{
unsigned char dc ;
TRISC = 0 ; // set PORTC as output
PORTC = 0 ; // clear PORTC
/*
* configure CCP module as 4000 Hz PWM output
*/
PR2 = 0b01111100 ;
T2CON = 0b00000101 ;
CCP1CON = 0b00001100 ;
CCP2CON = 0b00111100 ;
for(;;) // forever
{
/*
* PWM resolution is 10 bits
* don't use last 2 less significant bits CCPxCON,
* so only CCPRxL have to be touched to change duty cycle
*/
for(dc = 0 ; dc < 128 ; dc++)
{
CCPR1L = dc ;
CCPR2L = 128 - dc ;
Delay_ms(10) ;
}
for(dc = 127 ; dc > 0 ; dc--)
{
CCPR1L = dc ;
CCPR2L = 128 - dc ;
Delay_ms(10) ;
}
}
}
In short CCPRxL is the number of timer tics of your pulse being high, PR2 is the time it is low+time it is high, so if you want to set a low time just subtract that time from whatever you set PR2 to and put that value in CCPRx.