pwm_init output
Posted: 25 Mar 2010 11:17
hello all, i have a little question.
when creating pwm with the function pwm_init, let's say for example:
period= pwm_init(50,1,1,2) ( freq=50 Hz, channel=1, prescaler=1, timer2), so the peiod much me equal to 1/50=20ms.
but the output period is :6783 !!!
Another example:
if period =pwmm_init(500,1,1,2) so i changed the frequency to 500 hz, then period should be 1/500=2ms.
but the output is :39999 !!!
Does anyone understand what are these numbers ? and what kind of logic they follow, please reply
Best Regards.
when creating pwm with the function pwm_init, let's say for example:
period= pwm_init(50,1,1,2) ( freq=50 Hz, channel=1, prescaler=1, timer2), so the peiod much me equal to 1/50=20ms.
but the output period is :6783 !!!
Another example:
if period =pwmm_init(500,1,1,2) so i changed the frequency to 500 hz, then period should be 1/500=2ms.
but the output is :39999 !!!
Does anyone understand what are these numbers ? and what kind of logic they follow, please reply
Best Regards.