Hi Roger
I'm pretty new to this as well but I'd like a shot at answering your question. If I'm wrong I get shot down as well!
Freq Calc
PWM freq = Fosc/(PR2 + 1) x 4 x Prescale
With PR2 at 249 this is 4,000,000/250 x 4 x 4 = 1000 Hz.
Your 255 gives 4,000,000/256 x 4 x 4 = 976.56Hz which is what you measured.
Resolution formula as you stated. With PR2 at 249 then Resolution is Log 4 x 250/Log2 = 9.9657 = 1000 bit resolution (999.94 actually)
With PR2 ar 255 then resolution will be Log 4 x 256/Log2 = 10 bit but your frequency then can't be 1kHz ...only 976 Hz
Hope I got this all OK guys
Adrian
Bookmarks