AnsweredAssumed Answered

Clock Settings of MC9S12ZVMC128 for 100 MHZ

Question asked by gayatri meti on Feb 26, 2016
Latest reply on Mar 2, 2016 by Radek Sestak

Hi

 

Im working on the S912ZVMC12F1WKH "MAGNIV" Target microcontroller on the ECU and Im facing an issue of Exception(Control does not jump to startup after code flash and resets) while setting the PLL for 100 MHZ using the Crystal clock frequency 16MHZ. I have tried with the following settings as mentioned below:

 

CPMUCOP_REG = CPMUCOP_DISABLE_MASK;     /* Disable the MCU COP */

IVBR_REG = 0xFFFEU;                    /* Interrupt Vector Base */

  ECLKCTL = 0x80U;                        /* Set the NECLK = 1  in ECLK control register*/

  CPMUPROT = 0x26;                      /* Unprotect the Clock Setting registers*/

  CPMUCLKS = 0x40U;                  /* To enter into the Pseudo-Stop mode PSTP =1*/

  CPMUCLKS = 0x80U;                  /* To set the PLLSEL =1, for selection of PLL */

  POSTDIV = 0x00U;                      /* set the Postdiv to 0fpll = 100MHZ, */

  CPMUSYNR = 0x00U;                

  CPMUREFDIV = 0x07;                  /*To get the Fref = 2MHZ */

  CPMUOSC2 = 0x02U;                  /* To enable the Oscillator monitor reset*/

  CPMUOSC = 0x80U;                    /* To enable the Oscillator */

  CPMUPLL = 0x00U;                     /* frequency modulation = 00*/

  CPMUSYNR = 0xD8;                   /* SYNR = 24U, VCO frequency range in between 80 to 100 MHZ, VCOFREQ = 11 */

  while(CPMUIFLG_UPOSC == 0U) { 

  }

  CPMUPROT = 0x00;                

 

Please verify the code snippet and let me know why do I get an Exception after flashing the code asap.

 

Thanks & Regards

Gayatri

Outcomes