Hi Community,
I am using i.MX6ULL module with kernel 4.9 version. My requirement is to achieve 20MHz speed at PWM. Currently, I can reach up to 12MHz by setting the values from SYSFS.
Could you please help me on this with some example.
Regards,
Deven
Hi Artur,
I tried by changing the PWM frequency to 66MHz by modifying perclk to ipg in drivers/clk/imx/clk-imx6ul.c file.
- clks[IMX6UL_CLK_PWM5] = imx_clk_gate2("pwm5", "perclk", base + 0x80, 26);
+ clks[IMX6UL_CLK_PWM5] = imx_clk_gate2("pwm5", "ipg", base + 0x80, 26);
I confirmed in clk_summery also I am getting 66MHz,
# cat /sys/kernel/debug/clk/clk_summary |grep pwm5
pwm5 1 1 66000000 0 0
But still, I am unable to get 12 MHz by modifying duty_cycle and period.
Am I missing any thing ??
Regards,
Deven
What exactly values of duty_cycle and period do you use? Please specify. Please show the corresponding commands.
Artur
As per the hardware specifications (please refer to the i.MX6ULL Data Sheet document), the maximum allowed PWM reference clock frequency is 66MHz that results in maximum output frequency of 33MHz (at least 2 input clocks to one output clock).
In the Linux driver, the output frequency seems to be limited in the driver since, typically, much lower frequencies are used in real life, e.g. to control a display backlight. So, the driver code and, possibly, the reference clock configuration seem to be needed to be modified to achieve maximum PWM output frequency.
Best Regards,
Artur