Problem to exit DRUN Mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem to exit DRUN Mode

743 Views
borjagomez
Contributor I

Dear Sir / Madam

 

I am working with MPC5606B uC. I have imported an example project from import wizard and when i have tried to debug it  I have found problems to enter any mode different from DRUN mode. For instance, if I tried to enter the RUN0 mode (please find below source code) no transition to this mode is produced. I am using  TRK-MPC560xB evaluation board.

 

What problems may cause the microcontroller not to enter in running modes?

 

  ME.MER.R = 0x0000001D;          /* Enable DRUN, RUN0, SAFE, RESET modes */

                                  /* Initialize PLL before turning it on: */

/* Use 2 of the next 4 lines depending on crystal frequency: */

CGM.CMU_CSR.R = 0x000000004;  /* Monitor FXOSC > FIRC/4 (4MHz); no PLL monitor */

CGM.FMPLL_CR.R = 0x02400100; /* 8 MHz xtal: Set PLL0 to 64 MHz */

  ME.RUN[0].R = 0x001F0074;            /* RUN0 cfg: 16MHzIRCON,OSC0ON,PLL0ON,syclk=PLL0 */

                                                           /* Mode Transition to enter RUN0 mode: */

  ME.MCTL.R = 0x40005AF0;         /* Enter RUN0 Mode & Key */

  ME.MCTL.R = 0x4000A50F;         /* Enter RUN0 Mode & Inverted Key */ 

  while (ME.GS.B.S_MTRANS == 1) {}    /* Wait for mode transition to complete */   

                                  /* Notes: */

                                  /* 1. I_TC IRQ could be used here instead of polling */

                                  /*    to allow software to complete other init. */

                                  /* 2. A timer could be used to prevent waiting forever.*/ 

  while(ME.GS.B.S_CURRENTMODE != 4) {} /* Verify RUN0 is the current mode */

                                  /* Note: This verification ensures a SAFE mode */

                                  /*       transition did not occur. SW could instead */

                                  /*       enable the safe mode transition interrupt */

 

 

 

Thank you in advance,

 

Borja Gomez

Labels (1)
0 Kudos
0 Replies