Hello. I program with CCS, never tried with MikroC.
According to what I found PWM unit is controlled with:
PWM1_Init(frequency) --> Set the pulse frequency. Take into account that not every value is available since that frequency is taken from the oscillator, so you must look for any possible value.
PWM1_Set_Duty(dutycycle) --> Set the duty cycle. You can choose any combination. If your MCU PWM module has a 8-bit resulution, you can choose 256 values. 0=0, 50%=127, 100=255.
PWM1_Start() --> Start the modulation. Your pin now has a variable output.
PWM_Stop() --> Stops the modulation.
Do NOT use TMR2 while your PWM module is active. It works with that timer, so the only thing you can do with it is reading it but not modifying it (you can but it won't work properly, but you can do it for some applications).
Once you configure your pin as output and the PWM module, the only thing you have to do is changing the duty (if necessary).
Good bye.