imx93 GPIO to use as output PWM signal.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx93 GPIO to use as output PWM signal.

2,104 次查看
sbmd_1234
Contributor III

Hi,

I want to use the GPIO of imx93 as PWM output signal and also I want to set the duty cycle of it how can we configure this please help.


thanks.

0 项奖励
回复
6 回复数

2,081 次查看
spawn
Contributor III

Easy, look at the multiple examples in arch/arm64/boot/dts/. Pwm is named tpm.

0 项奖励
回复

2,076 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!

Thank you for contacting NXP Support!

 

I am able to use the PWM on iMX93 EVK board.

 

  1. Add the CONFIG_PWM_IMX_TPM to the imx_v8_defconfig file.
  2. Add the configuration to the device tree.
    &tpm4 {
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_tpm4>;
            status = "okay";
    };
    
    pinctrl_tpm4: tpm4grp {
            fsl,pins = <
                MX93_PAD_GPIO_IO05__TPM4_CH0	0x19e //EXP_GPIO_IO05 J1001 29
            >;
        };​
  3.  When you flash the new Image and device tree to the board:
    $ cd /sys/class/pwm/pwmchip1/
    $ echo 0 >> export
    $ echo echo 2000000 >> pwm0/period
    $ echo echo 1000000 >> pwm0/duty_cycle
    $ echo 1 >> pwm0/enable
  4. You can validate the signal on the pin 27 of the J1001 of the iMX93 EVK boardChavira_0-1729099999966.png

     

    Chavira_1-1729100036533.png

     

    Best Regards!
    Chavira

 

0 项奖励
回复

2,044 次查看
sbmd_1234
Contributor III

Hi, @Chavira 

I've enabled the config in menuconfig and added the dts changes I am able to get the /sys/class/pwm/pwmchip4 but the gpio pin of imx93 evk is not generating any signal?

though, I've wrote the duty_cycle, period and enabled also but still not worked.

can you please tell what could be the reason.

Thanks.

0 项奖励
回复

2,034 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!

In my case the TPM is the pwmchip1.

 

Please refer to the next guide that I published today.

 

Best Regards!

Chavira

0 项奖励
回复

1,989 次查看
sbmd_1234
Contributor III

Hi @Chavira 

I am having a doubt, I am working on i.MX91 custom evaluation board so that board contains the GPIO2_IO05 pin header. My question is can we test the PWM signal on this pin if we configure this  "MX93_PAD_GPIO_IO05__TPM4_CH0" but can we check this on this pin "MX93_PAD_GPIO_IO05__GPIO2_IO05"?


Thanks for your support.

0 项奖励
回复

1,944 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @sbmd_1234!

I don´t have access to the iMX91 documentation from now.

 

For this case I recommend to ask to your local DFAE for support.

 

Best Regards!

Chavira

0 项奖励
回复