AnsweredAssumed Answered

S32K144's OSC clock is not valid

Question asked by cheng sz on Aug 7, 2019
Latest reply on Aug 20, 2019 by cheng sz

Phenomenon:

 S32K144's system OSC(SOSC_CLK) is always not valid.

“ while(!(SCG->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK));”  is running forever。

SOSCCSR.SOSCVLD is  always 0.

 

The clock source code are as follows。

void SOSC_init_8MHz(void) {
SCG->SOSCDIV=0x00000101; /* SOSCDIV1 & SOSCDIV2 =1: divide by 1 */
SCG->SOSCCFG=0x00000024; /* Range=2: Medium freq (SOSC betw 1MHz-8MHz)*/
/* HGO=0: Config xtal osc for low power */
/* EREFS=1: Input is external XTAL */


while(SCG->SOSCCSR & SCG_SOSCCSR_LK_MASK); /* Ensure SOSCCSR unlocked */
SCG->SOSCCSR=0x00000001; /* LK=0: SOSCCSR can be written */
/* SOSCCMRE=0: OSC CLK monitor IRQ if enabled */
/* SOSCCM=0: OSC CLK monitor disabled */
/* SOSCERCLKEN=0: Sys OSC 3V ERCLK output clk disabled */
/* SOSCLPEN=0: Sys OSC disabled in VLP modes */
/* SOSCSTEN=0: Sys OSC disabled in Stop modes */
/* SOSCEN=1: Enable oscillator */

 

while(!(SCG->SOSCCSR & SCG_SOSCCSR_SOSCVLD_MASK)); /* Wait for sys OSC clk valid */

}

Outcomes