If by “glitch free” you mean free of any resolution error, not every frequency or duty cycle you want to generate will be.
for any particular frequency, you need the pic’s clock frequency to tell you that.
This online PWM calculator can tell you:
http://www.micro-examples.com/public...alculator.html
whether or not you can change it for arbitrary duration for every pulse like that would be a tough one,
I don’t think that’s possible, but might be wrong.
Depending what else the chip has to do, it might be possible to use timer1 overflow that way.
Bookmarks