Quote Originally Posted by lerameur View Post
I have a program here, I guess it is somewhat working.
It's a start eh?

I get a very erratic output, I need a steady frequency with a varying duty cycle. What I see on the scope is varying duty cycle frequency going in all direction,
Are you sure it's actually the frequency varying and not the 'scope triggering at different points?

Do you have an LCD (or anything similar) that you can output the variable DUTYCYCLE to, so you can monitor it?
How about a small cap across the ADC input pin to smooth that out just a bit? Most pot's aren't exactly clean...
And try left justify...16F88 has a 10 bit ADC. PBP manual says 8 bit ADC results should be LEFT justified. Maybe a high sampling time.