PWM trigger in imxrt1176

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

PWM trigger in imxrt1176

1,304 次查看
Devaharsha
Contributor III

Hi,

I have used PWM example, given in SDK. The code has been modified so that 50Hz signal will generate from PWM_Submodule0 (both from PWMA & PWMB pins). The code is working fine.

Now, I want to count the number of rising edges in the signal. Can anyone help in how exactly this can be done?

Thanks,

Devaharsha 

0 项奖励
回复
3 回复数

1,282 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

Could you elaborate further? or could you give an explanation about the solution you want to achieve?

Best regards,
Pavel

0 项奖励
回复

1,279 次查看
Devaharsha
Contributor III

Hi,

For generating PWM signal, I am using modified SDK example such that the signal will be of 50 Hz. 

I am using this signal as the input to stepper motor. What I understood is, the stepper motor steps every time a rise edge signal is detected. So, if I want lets say 50 degrees that corresponds to 200 steps, there should be 200 rising edges as the input. 

Can you help with this issue on how to count number of rising edges in the PWM signal?

Thanks

Devaharsha    

0 项奖励
回复

1,272 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, 

Thanks for being clear, I suggest using the FTM input capture to detect the rising edge and count, to do that there is no example available for that solution in the SDK. 

I recommend reviewing this app note this is for LPC but using the same module of eflexPWM maybe could help you to get more details to implement in your application.

Stepper Motor Control on LPC55S3x (nxp.com)

Best regards,
Pavel

 

0 项奖励
回复