Kinetis K60 oscillator selection

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

Kinetis K60 oscillator selection

Jump to solution
1,190 Views
sowmyabr
Contributor II

Hello,

We are working on K60 controller and our custom board. As per our understanding bsp clock is configured for external oscillator 0 with 50MHz and the same clock is bypassed for ethernet clock.

But we have to configure the bsp clock for external crystal and it should run with oscillator 1 which is 25 MHz. We are turning on/off ethernet at run time in our application.

Since external oscillator 0 is used to PLL0 and for core clock and ethernet clock, the controller is resetting when we switch off ethernet.

We tried to changed the bsp for selecting PLL0 reference clock as oscillator 1 but in no avail.

RTOS 4.1 version we are using and referred to pe expert but that did not helped.

Please help us in fixing the issue.

Regards,

Sowmya

Labels (1)
0 Kudos
1 Solution
619 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Sowmya,

It need to enable OSC1 by configuring it in the MCG_C10 register – set up the parameters just like OSC0. Then you have to enable it by setting the ERCLKEN bit in

the OSC1_CR register. Once you have the OSC1 enabled, you can then select it as the reference for PLL0 or PLL1. It is tricky if you want to use OSC1 as the reference

for the PLL that is providing the system clock in PEE mode. You must first transition from FEI to FBE to PBE before switching from PBE to PEE. You can only be in FBE

mode (and PBE) using either OSC0 or the RTC clock as the external clock source. You cannot be in there clock modes with OSC1.

Please refer attached code(bare-metal project) about PLL0 or PLL1 using OSC1 crystal clock.

Wish it helps.


Have a great day,
Ma Hui

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

View solution in original post

0 Kudos
2 Replies
620 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Sowmya,

It need to enable OSC1 by configuring it in the MCG_C10 register – set up the parameters just like OSC0. Then you have to enable it by setting the ERCLKEN bit in

the OSC1_CR register. Once you have the OSC1 enabled, you can then select it as the reference for PLL0 or PLL1. It is tricky if you want to use OSC1 as the reference

for the PLL that is providing the system clock in PEE mode. You must first transition from FEI to FBE to PBE before switching from PBE to PEE. You can only be in FBE

mode (and PBE) using either OSC0 or the RTC clock as the external clock source. You cannot be in there clock modes with OSC1.

Please refer attached code(bare-metal project) about PLL0 or PLL1 using OSC1 crystal clock.

Wish it helps.


Have a great day,
Ma Hui

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

0 Kudos
619 Views
sowmyabr
Contributor II

Hello Hui_Ma,

Thank you for reply and support. I implemented the same as suggested by you and it is working.

Now the system is working as follows :

On power up , oscillator 0 configuration and bsp initialisation . But we need the oscillator selection 1 at power up. Because ethernet will be disabled at power up and there will be no oscillator 0  at power up. I hope the system can boot from oscillator 1 if we change the bsp clock configuration.

We will try to modify the bsp and will come back if we face any issue.

Thanks alot.

Regards,

Sowmya

0 Kudos