Does it work to use only OSC1 for K70?

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

Does it work to use only OSC1 for K70?

1,321 Views
applefly
Contributor II

Hi,

  My hardware has only OSC1 as external clock source.

  I want to use this OSC1 as external clock source to driver PLL0/PLL1 for  MCG module.

  My questions are,

  1. Does it work? Per some discussions here I know some restrictions on using OSC1 to drive MCGOUT.

      So, if my hardware has only OSC1(no OSC0 and RTC), this system can work?

  2. If this system can work, where I can find sample code ?

      I use CW 10.5, project is base on KINETIS_120MHZ_SC.zip.

Regards,

Mark

Tags (1)
5 Replies

1,045 Views
waqasbutt
Contributor II

This is the code that i am using for MCG initialization. I am using K20 controller. I have only attached OSC1 still my code is working properly

MCG->C2 = (uint8_t)0x1Cu;

MCG->C10 = (uint8_t)0x1Cu;

MCG->C1 = (uint8_t)0xA0u;

MCG->C5 = (uint8_t)0x80u;

MCG->C6 = (uint8_t)0x00u;

MCG->C6 = (uint8_t)0x40u;

while((MCG->S & MCG_S_PLLST_MASK) == 0u);

while((MCG->S & MCG_S_LOCK0_MASK) == 0u);

MCG->C1 = (uint8_t)0x20u;

while((MCG->S & 0x0Cu) != 0x0Cu);

while((MCG->S & MCG_S_LOCK0_MASK) == 0u);

0 Kudos
Reply

1,045 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Mark:

Unfortunately the answer is no, you cannot use OSC1 alone. At least you have to temporarily run MCGOUT from OSC0 *or* RTC and then switch over to OSC1 to work in PEE mode. The restriction here is that you need to pass through FBE and PBE clock modes, and such modes require an external reference clock, which can be either of OSC0 or RTC, but never OSC1.

The next picture shows my point. In red are the clock path and modes that need OSC0 or RTC, while in blue is the only mode that supports using OSC1.

On the other hand, you can notice that the system could work using only OSC0.

Clock_options.png

Hope this helps to clarify.

Regards!

Jorge Gonzalez

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

1,045 Views
rameshgoud
Contributor II

Hi Jorge,

                I faced the same problem as am trying to use OSC1 as external reference for MCGOUT. As you said that after entering into PEE mode, what is the configuration settings to switch back to OSC1 from OSC0 and such that both PLLs are having external reference from OSC1 only

0 Kudos
Reply

1,045 Views
applefly
Contributor II

Thanks for your answer.

Let me clarify my position...

OK, from the picture in your answer the MCGOUTCLK doesn't work.

How about the MCGFLLCLK, MCGPLL0CLK and MCGPLL1CLK?

Use the hardware with OSC1 alone, may I enable the LCD control to active a TFT panel ?

Mark

0 Kudos
Reply

1,045 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Mark:

According to the reference manual, seems that you can use MCGPLL0CLK or MCGPLL1CLK to provide clock to the LCD module, but not MCGFLLCLK. Check the clocking options:

LCD_clocks.png


Regards!
Jorge Gonzalez

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

0 Kudos
Reply