With a 4MHz Xtal, the closest you can get to 140kHz is 142,857 Hz. This gives a duty cycle resolution of just under 5 bits.Using a 628 I'd like to know if I can get the full 8bit precision range at 140kHz on a 4MHz crystal or if I have to move to a 20MHz crystal.
With a 20HMz xtal, the closest you can get to 140kHz is 138,888. This gives a duty cycle resolution of just over 7 bits.
almost, see equation in datasheet for calculating resolution...is it that simple to figure out that at 140kHz I'd have only log2(4000/140) bits of precision on a 4MHz crystal?
No, the current cycle completes so you should get a smooth transition.Also, if I change the duty cycle, does it always force the timer to restart at 0, or can I smoothly sweep the duty cycle?
See the datasheet for source of my calcs and information. If you need help calculating other options, please reply back.
Good Luck,
Paul Borgmeier
Salt Lake City, Utah
USA
Bookmarks