Hello Deepti Moodliar:
Both cases you mentioned are possible, using IRC48M as reference or RTC with a 32.768 kHz crystal.
- With IRC48M you can get a max system clock of 120 MHz.
- With the 32.768 kHz the maximum system clock would be 96 MHz.
Attached there are 2 KDS projects with KSDK v1.3 + Processor Expert. You should take a look to the macros generated in the header file system_MK64F12.h and how these are used to initialize clocks in the function SystemInit() from the source file system_MK64F12.c.
Project (1) configures a system clock of 120 MHz with the IRC48M as reference. According to appnote AN4905 for K64 it is required to enable the IRC48M, so I added the next code to SystemInit():
/* Enable the IRC48M reference according to AN4905 */
// Enable the clock to the USB module
SIM_SCGC4 |= SIM_SCGC4_USBOTG_MASK;
// Enable the IRC48M oscillator
USB0_CLK_RECOVER_IRC_EN |= 2;
Project (2) uses the RTC with a 32.768 kHz crystal to set a system clock of 96 MHz.
I hope this helps. Let me know if any doubts.
Best regards!
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------