AnsweredAssumed Answered

MCG configuration in mqx for k65f180m for using internal reference clock

Question asked by annamol alex on Dec 30, 2015
Latest reply on Jan 1, 2016 by Mark Butcher


I am trying to configure the internal reference clock for K65F180m in mqx. I have read the utasker documentation on MCG modes and have gone through the reference manual. I have certain doubts regarding MCG. It would be of great help if anyone can clarify them

  • For using the IRC, I could find only these configurations. Is there anything more missing (the values configured in registers are mentioned in barckets)
    • MCG_C1-> CLKS(1) ,IREFS (1), IRCLKEN(1)
    • MCG_C7 ->OSCSEL(2)
    • OSC_CR ->ERCLKEN (0)
    • MCG_S ->IREFST(1),CLKST(1),IRCST(1)

  • When i add the above configurations in my project, the debugging session stops. It might be because of the mismatch in clock. But I read in a post that Jlink OpenSDA won't have issue with lower clock. but mine is openSDA.
  • In mqx project, i made the following changes in bsp_cm.c file. i am not sure if this is correct or not
    • for making that change i commented off the OSC_CR and mode changing sections in pe_initialize_hardware


void __pe_initialize_hardware(void)


    /* OSC Configure */


//    /* after enter FEI Mode */

//    Cpu_SetMCGModeFBE(0);

//    Cpu_SetMCGModePBE(0);

//    Cpu_SetMCGModePEE(0);



  • Is it possible to completely remove the external crystal and power up the board. In all the initialization sections, I could see the external reference clock being used in code. Can we do it using the 32KHz and 4MHz crystals available?
  • Can we generate the code to use internal reference clock alone for the K65  MCU using processor expert? Is there any document available for the same
  • In the MCG documentation, we  have MCG in FEI mode when it comes out of reset, Is this reset referring to a full system reset? Does this mean that an external crystal is needed for the MCU operation. Is crystal less operation possible, any document available for the same.