Can I use a 24MHz crystal to generate MCGOUTCLK ?

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

Can I use a 24MHz crystal to generate MCGOUTCLK ?

685 Views
alainbenoit
Contributor I

Hello,

I am using a Kinetis MK21FN1M0V12. I linked its EXTAL0 and XTAL0 pins to a 24MHz quartz (with two 10pF load capacitors).

I would like to use the 24MHz OSCCLK clock generated by the OSC module as main clock (MCGOUTCLK). I attached to this message the clock path I would like to use.

However, I cannot go from MCG mode FEI (default reset mode using internal clock and FLL) to MCG mode FBE (using external clock, with FLL active but disconnected) because my 24MHz OSCCLK cannot be divided by FRDIV into the 31-39kHz range required by the FLL: FRDIV value would need to be around 750 but the two closest values are 512 and 1024, which are both putting the frequency out of range (23kHz and 47kHz).

I cannot access modes BLPE and PBE either because they can only be reached through mode FBE.

I tried to cheat my way out by using the RTC clock as external clock instead of OSCCLK, going to mode BLPE and then switching OSCSEL back to OSCCLK but the MCU crashed, this operation does not seem to be allowed.

How can I use OSCCLK as MCGOUTCLK in this case? Is there a solution or is 24MHz a forbidden value for this specific use?

Thanks in advance for your answers,

Labels (1)
0 Kudos
2 Replies

536 Views
mjbcswitzerland
Specialist V

Alain

MCG_C1:

pastedImage_0.png

MCG configuration: µTasker MCG Configuration Support

When moving from FEI to FBE the FLL is still locked to the 32kHz IRC source so the external clock frequency is not relevant.

Regards

Mark

Kinetis: µTasker Kinetis support

K21: µTasker Kinetis TWR-K21D50M support  / µTasker Kinetis TWR-K21F120M support

MCG configuration: µTasker MCG Configuration Support

For the complete "out-of-the-box" Kinetis experience and faster time to market

536 Views
alainbenoit
Contributor I

That makes sense, thanks a lot!

0 Kudos