“This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.”
The ARM Cortex-M4F on the Freescale FRDM-K64F board can run up to 120 MHz. Here is how to get it running with maximum speed:
FRDM-K64F Board
Below figure shows the block diagram of the FRDM-K64F design along with primary components and their placement.
The Kinetis MCU startup from an internal digitally-controlled oscillator (DCO). Software can enable the main external oscillator (EXTAL0/XTAL0) if desired. The external oscillator/resonator can range from 32.768 KHz up to 50 MHz. The default external source for the MCG oscillator inputs (EXTAL) is 50 MHz clock source from Micrel Ethernet PHY.
There are three clock sources which can be given to this board
1) The 32.768 KHz crystal is connected to the RTC oscillator inputs EXTAL32 (RTC block as shown in below figure).
2) The Ethernet PHY will provide 50 MHz clock to MCU EXTAL0 (system osc block in below figure)
3) The IRC 48MHz present internally (IRC48M internal osc as shown in below figure)
The K64F processor on the board has many clock options as shown here:
K64F clocking diagram (Source: Freescale K64F Reference Manual)
The RTC oscillator (EXTAL32, XTAL32) clock on the board is a 32 kHz oscillator:
The Y3 is nearby the CPU:
32.768 kHz Clock on FRDM-K64F
This clock can be used with the FLL, but does not allow a system clock above 100 MHz
so next option is, the System Oscillator block which can be used (EXTAL0/XTAL0):
Main Clock (Source: FRDM-K64F Schematics)
The XTAL0 is connected to ground, and EXTAL0 is connected to the Micrel Ethernet PHY chip which has a 25 MHz crystal attached:
25 MHz and Micrel PHY (Source: FRDM-K64F Schematics)
The picture below shows the clock and the PYH
25 Mhz and PHY
The important thing to know is that the output clock (REF_CLK) is twice of the 25 MHz clock: a 50 MHz oscillator clock. With this information, I can configure the settings of the CPU in Processor Expert as below to produce a 120 MHz PLL output:
120 MHz PLL output configuration in Processor Expert
This gives me a 120 MHz core clock:
120 MHz Core Clock
The other option available is IRC internal reference clock. If you carefully inspected the clocking block diagram, you should have noticed that there is a 48 MHz internal reference clock. This is something very cool Freescale has finally introduced: with this it is possible to use the K64F for USB operation *without* the need for an external reference clock. And of course this one can be used to reach 120 MHz too. Simply select that 48 MHz clock as reference clock:
Internal Reference Clock with 48 MHz
So I have two ways on the FRDM board to run the core at 120 MHz now
And yes, you can try to configure the clocks without Processor Expert too. With Processor Expert it is just a few clicks, while without…. well, try to read and understand the data sheet