Documented pwm_init parameters , unclear period

ddze7374
Posts: 8
Joined: Tue Dec 06, 2016 4:09 pm

Documented pwm_init parameters , unclear period

Postby ddze7374 » Mon Sep 11, 2017 6:01 pm

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?

User avatar
pratik
Posts: 450
Joined: Wed Jun 29, 2016 7:17 pm
Location: India
Contact:

Re: Documented pwm_init parameters , unclear period

Postby pratik » Tue Sep 12, 2017 3:57 pm

That is because the period unit is micro-sec. :)
That's why if you set it to 1000, you get 1ms -> 1kHz
Regards,
Pratik Panda
Website: http://www.PratikPanda.com

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):
http://www.iot-bits.com

ddze7374
Posts: 8
Joined: Tue Dec 06, 2016 4:09 pm

Re: Documented pwm_init parameters , unclear period

Postby ddze7374 » Wed Sep 13, 2017 9:39 pm

Thanks Pratik

Who is online

Users browsing this forum: No registered users and 12 guests