Clock setting for PWM operation

cancel
Showing results for 
Search instead for 
Did you mean: 

Clock setting for PWM operation

Jump to solution
201 Views
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.

 

Labels (1)
0 Kudos
1 Solution
175 Views
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

View solution in original post

0 Kudos
1 Reply
176 Views
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 Kudos