Hi Eric_t d,
I'm not sure from your question if you already configured the PLL filter. If yes, could you send me the code with your settings?
If not, for the configuration PLL, I recommend you PLL calculator S12X PLL (Filter) Calculator
There you can choose oscillator and BUS clock frequency and calculate the setting of the registers and set it in the PLL_Init function below.
Below you can see example code for the PLL settings of the S12XEP100 MCU, you can use it for the S12XEQ512 and you can be inspired which registers you should set for the S12XDT512.
void PLL_Init(unsigned char synr, unsigned char refdv, unsigned char postdi) {
PLLCTL = 0B00000001; // CME=0,PLLON=0,FM1=0,FM2=0,FSTWKP=0,PRE=0,PCE=0,SCME=1
CLKSEL = 0B00000011; // PLLSEL=0,PSTP=0,PLLWAI=0,RTIWAI=1,COPWAI=1
SYNR = synr; // Set the multiplier register
REFDV = refdv; // Set the divider register
POSTDIV = postdiv; // Set the post divider register
PLLCTL_PLLON = 1; // Enable the Phase Lock Loop
while(!CLKSEL_PLLSEL) // PLLSEL=1 check
{ while(!CRGFLG_LOCK); // Wait till the PLL VCO is within tolerance
CLKSEL_PLLSEL = 1; // Select clock source from PLLCLK
}
}
void main(void) {
PLL_Init(0xC4,0x83,0x00); // 50MHz BUSCLK from 40MHz OSCCLK
for(;;) {} /* wait forever */
/* please make sure that you never leave this function */
}
I hope it helps you.
Best regards,
Diana