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;
}
Hi Claudio Brunelli,
Enable the PEE mode need to follow this diagram.
I use the KDS PE create a project which is configuring the PEE mode,
I attach the project for your reference.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Kerry.
Sorry the delay in answering you. I prefer don't use PE. But I'm going to try your suggestion to use PE generated code. I will write soon as I can try.
Thanks.
Claudio
Hi Claudio,
PE code is just for your reference, you can don't use it, but just follow the code process write your own code.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------