AnsweredAssumed Answered

Problem in setting the system clock for MPC5744P

Question asked by nathan 米 on Sep 21, 2017
Latest reply on Sep 27, 2017 by nathan 米

I want to set the PLL0_PHI to 1 MHz with a 10MHz XOSC.

My code is as follows:

 

/* Configure PLL0 to 1 MHz with a 10MHz XOSC. */
PLLDIG.PLL0DV.B.RFDPHI1 = 10;
PLLDIG.PLL0DV.B.RFDPHI = 20;
PLLDIG.PLL0DV.B.PREDIV = 5;
PLLDIG.PLL0DV.B.MFD = 10;

// Mode Transition to enter RUN0 mode:
MC_ME.MCTL.R = 0x40005AF0; // Enter RUN0 Mode & Key
MC_ME.MCTL.R = 0x4000A50F; // Enter RUN0 Mode & Inverted Key
while (MC_ME.GS.B.S_MTRANS) {}; // Wait for mode transition to complete
while(MC_ME.GS.B.S_CURRENT_MODE != 4) {}; // Verify RUN0 is the current mode

 

When I debug the code, I find that the program stops at the following line:

while (MC_ME.GS.B.S_MTRANS) {}; // Wait for mode transition to complete

 

which means the mode transition to RUN0 never completes

 

But when I change the number of PLLDIG to 

PLLDIG.PLL0DV.B.RFDPHI1 = 4;
PLLDIG.PLL0DV.B.RFDPHI =4;
PLLDIG.PLL0DV.B.PREDIV = 1;
PLLDIG.PLL0DV.B.MFD = 16;

 

 the program has no problem.

 

I wonder what's wrong with my previous code? Is there any regulations about the PLLDIG register I don't know?

 

Thank you.

Outcomes