Page 1 of 1

Documented pwm_init parameters , unclear period

Posted: Mon Sep 11, 2017 6:01 pm
by ddze7374
Hi,

Documentation of the function pwm_init claims that the parameter uint32 period is in fact PWM period. But actually when I set it to 1000 , I got the PWM output of ~1000 Hz which is the frequency. Period would mean 1/1000 -> 0.001s (1ms).

Am I missing something or it is a wrong description?

Re: Documented pwm_init parameters , unclear period

Posted: Tue Sep 12, 2017 3:57 pm
by pratik
That is because the period unit is micro-sec. :)
That's why if you set it to 1000, you get 1ms -> 1kHz

Re: Documented pwm_init parameters , unclear period

Posted: Wed Sep 13, 2017 9:39 pm
by ddze7374
Thanks Pratik