Max speed of PWM in imx6ull

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Max speed of PWM in imx6ull

1,366 Views
deven_solanki
Contributor III

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

Labels (1)
Tags (2)
0 Kudos
3 Replies

1,252 Views
deven_solanki
Contributor III

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

0 Kudos

1,252 Views
art
NXP Employee
NXP Employee

What exactly values of duty_cycle and period do you use? Please specify. Please show the corresponding commands.

Artur

0 Kudos

1,252 Views
art
NXP Employee
NXP Employee

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

0 Kudos