How to correct the pwm width according to feed back in Pic 16f series can anybody help me by giving some logic ? My pwm frequency is 5KHz.

Thank you.