Core Clock divide

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Core Clock divide

1,087 Views
akimata
Contributor IV

Hello,

I've got strange problem using SIM_CLKDIV1 to lower core clock on K80

I'm running PLL on this board and i want to be able to divide high PLL clocks to not exceed bus/core clocks limits.

The problem is if i use this:

SIM -> CLKDIV1 = (SIM_CLKDIV1_OUTDIV1(0)| //core
SIM_CLKDIV1_OUTDIV2(1)| // Busclk
SIM_CLKDIV1_OUTDIV3(3)| // FlexBus
SIM_CLKDIV1_OUTDIV4(7)); // Flash

It works, every clock is divided properly but if i try:

SIM -> CLKDIV1 = (SIM_CLKDIV1_OUTDIV1(1)| //core
SIM_CLKDIV1_OUTDIV2(1)| // Busclk
SIM_CLKDIV1_OUTDIV3(3)| // FlexBus
SIM_CLKDIV1_OUTDIV4(7)); // Flash

Write is ignored and i end up with default values. Where is the catch? I read that maximum divide ratio between core and other clocks is 8 but i'm not exceeding this limitations

Thanks for any help :smileyhappy:

0 Kudos
Reply
3 Replies

926 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I am using Clocks tool of MCUXpresso IDE, the GPIO example is able to run after modify the divider.

GPIO example Clocks Tool default.png

GPIO example Clocks Tool modified.png

SIM_CLKDIV1 debug.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

926 Views
akimata
Contributor IV

That's really usefull feature in MCUXpresso and now i'm able to set SIM_CLKDIV1 correctly but i noticed that's not perfect.

Not sure if it's bug or i'm doing something wrong but if i want to clock my UART using this tool it's not working properly, wrong clock is selected.

How it's setuped:

clocksx1.JPG

Register values in clocks tab :

clockx2.JPG

What i get after i run the code:

clockx3.JPG

And the problem is not only when i want to use PLL to feed UART, it always end up with OSCERCLK clock.

0 Kudos
Reply

926 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please check if there is someplace else select the clock of LPUART again.
For example: the lpuart_interrupt will select OSCERCLK after BOARD_BootClockRUN

CLOCK_SetLpuartClock.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply