How to rise the clock frequency in FRDM K64F to 96 MHz using the FLL in the MCG module?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to rise the clock frequency in FRDM K64F to 96 MHz using the FLL in the MCG module?

Jump to solution
242 Views
gutierrez_arce_
Contributor I

Hi

I am working with your FRDM K64F in bare metal. I read Chapter 25 (MCG) of the reference manual and I have managed to rise the clock frequency to 24 MHz using the FLL module by setting DMX32 bit in MCG_C4 register right after a system reset. However, when trying to rise the clock frequency by changing DRST_DRS bits in  MCG_C4 register to any other value different to 00, the program crashes. How can I achieve 96 MHz clock frequency shown in the table below? I am currently working within FEI mode, which is the default mode after a system reset.

clockRise.png

Thank you in advance

Alvaro

0 Kudos
1 Solution
106 Views
mjbcswitzerland
Specialist V

Hi

See http://www.utasker.com/kinetis/MCG.html for a bare-metal programmer's guide to using the MCG.

Don't forget to correctly program the bus and (especially) flash clock dividers before setting a fast FLL: Out of specification flash clock will otherwise cause immediate failure.

For most successful bare metal code development use the uTasker project and its K64 simulator; the simulator tells you if you are doing anything wrong and you can focus on efficient development work.

Regards

Mark


Complete Kinetis solutions for professional needs, training and support: http://www.utasker.com/kinetis.html
Kinetis K64:
- http://www.utasker.com/kinetis/FRDM-K64F.html
- http://www.utasker.com/kinetis/TWR-K64F120M.html
- http://www.utasker.com/kinetis/TEENSY_3.5.html
- http://www.utasker.com/kinetis/Hexiwear-K64F.html
uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market
Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html

Open Source version at https://github.com/uTasker/uTasker-Kinetis

View solution in original post

0 Kudos
4 Replies
106 Views
nxf54945
NXP Employee
NXP Employee

Hello Álvaro,

I hope you are doing well.

Whenever you change the clock of the MCU, you must wait until the clock signal stabilizes before executing any instruction, otherwise your program will most certainly crash.

You can use the clock Config Tool of MCU Xpresso to select the MCG configuration that you like and apply it to your MCU through the clock SDK driver (fsl_clock.c).

I hope this info comes handy. Do not hesitate to ask about any doubt or concern you have about your application.

 

Best regards

Javier

0 Kudos
107 Views
mjbcswitzerland
Specialist V

Hi

See http://www.utasker.com/kinetis/MCG.html for a bare-metal programmer's guide to using the MCG.

Don't forget to correctly program the bus and (especially) flash clock dividers before setting a fast FLL: Out of specification flash clock will otherwise cause immediate failure.

For most successful bare metal code development use the uTasker project and its K64 simulator; the simulator tells you if you are doing anything wrong and you can focus on efficient development work.

Regards

Mark


Complete Kinetis solutions for professional needs, training and support: http://www.utasker.com/kinetis.html
Kinetis K64:
- http://www.utasker.com/kinetis/FRDM-K64F.html
- http://www.utasker.com/kinetis/TWR-K64F120M.html
- http://www.utasker.com/kinetis/TEENSY_3.5.html
- http://www.utasker.com/kinetis/Hexiwear-K64F.html
uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market
Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html

Open Source version at https://github.com/uTasker/uTasker-Kinetis

View solution in original post

0 Kudos
106 Views
gutierrez_arce_
Contributor I

Thanks a lot, after checking the divider value from Flash clock, I was able to rise System clock up to 96 MHz.

0 Kudos
106 Views
mjbcswitzerland
Specialist V

Hi

Thanks for the feedback!

Yes, flash clock is very critical - even setting its clock to 1MHz above its maximum allowed frequency for a single instruction period can cause immediate failure!

Regards

Mark

0 Kudos