PWM generation on iMXRT1176

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

PWM generation on iMXRT1176

跳至解决方案
1,057 次查看
Devaharsha
Contributor III

The PWM example in the SDK generates a 1KHz signal from PWM submodule_0 and submodule_1 in complementary mode. I want to run two servo motors in independent mode using PWM. The servo uses a 50Hz signal i.e. 20ms. So, anyone can help me where the modification is required for the same?

1) I have changed the code for independent mode because I have to run 2 servos with different duty cycles.

2) I have modified pwmclk but it's not working. (in PWM_DRV_Init3PhPwm() function)

3) I have modified pwmfreq (set to 1000UL in SDK) but I can't get a 50Hz signal. (in PWM_DRV_Init3PhPwm() function)

Can anyone help me figure out where the modification is required?

0 项奖励
1 解答
1,004 次查看
Devaharsha
Contributor III

Thanks Edwin.

Actually changing presale to 128 and APP_DEMO_FREQ to 50U generates 50hz signal.

在原帖中查看解决方案

0 项奖励
2 回复数
1,032 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Devaharsha 

Some quick questions in order to get a better insight of your inquiry:

How did you modify these variables that you mention?

When you mention that these changes aren’t working, do you mean that the pwm signal does not change at all, or it doesn’t change as desired?

 

BR,

Edwin.

 

0 项奖励
1,005 次查看
Devaharsha
Contributor III

Thanks Edwin.

Actually changing presale to 128 and APP_DEMO_FREQ to 50U generates 50hz signal.

0 项奖励