Clock setting for PWM operation

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

Clock setting for PWM operation

跳至解决方案
1,157 次查看
emdev
Contributor III

Hello,

I can obtain PWM signal output by reference evkbimxrt1050_pwm example.

But when I operate not only PWM but also I2C, I2C has always error.

And I found that below code is cause of problem.

CLOCK_SetDiv(kCLOCK_AhbDiv, 0x2);

If I use below code(which can be found BOARD_BootClockRUN()), I2C can operate well.

CLOCK_SetDiv(kCLOCK_AhbDiv, 0x0);

I want to use PWM and I2C simultaneously.

Would you recommend how I can set PWM properly?

Thanks in advance.

 

标签 (1)
0 项奖励
回复
1 解答
1,131 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Hope you are well. I apologize for my delayed reply.

For I2C I suggest you select USB1PLL as clock source as the I2C example uses. The limitation of the LPI2C clock is that it must be lower or equal to 66MHz.
For the PWM I suggest you keep the default configuration from  BOARD_BootClockRUN() avoiding the modification of the AHB divider.

If you have more questions do not hesitate to ask me.
Best regards,
Omar

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,132 次查看
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello
Hope you are well. I apologize for my delayed reply.

For I2C I suggest you select USB1PLL as clock source as the I2C example uses. The limitation of the LPI2C clock is that it must be lower or equal to 66MHz.
For the PWM I suggest you keep the default configuration from  BOARD_BootClockRUN() avoiding the modification of the AHB divider.

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 项奖励
回复