AnsweredAssumed Answered

FRDMK22 enable PEE mode

Question asked by Claudio Brunelli on Nov 27, 2017
Latest reply on Nov 30, 2017 by Kerry Zhou

Hi.

I'd like to move my frdmk22 board, to PEE clock mode but I can't see different clock even changing values

in the below code.

Do I forget something ? Or ther's something wrong in my code ?

Thanks in advance...

Claudio

 

void PEE_InitMode(void)
{
    MCG->C2 = 0x2C;
    MCG->C1 = 0x98;
    while ((MCG->S & MCG_S_OSCINIT0_MASK) == 1)    ;    
    while ((MCG->S & MCG_S_IREFST_MASK) == 0);        
    while ((MCG->S & MCG_S_CLKST(10)) == 0x10);

 

    MCG->C5 = 0x03;  // /4
    MCG->C6 = 0x41;  // *25
    while ((MCG->S & MCG_S_PLLST_MASK) == 1);
    while ((MCG->S & MCG_S_LOCK0_MASK) == 1);

 

    MCG->C1 = 0x01;
    while ((MCG->S & MCG_S_CLKST(01)) == 0x01);

 

    SIM->SOPT2 |= SIM_SOPT2_PLLFLLSEL_MASK;
}

Outcomes