clock mode is PEE, 12MHZ crystal. init code is generated under PE, External crystal doesnot work , and program halts at "while((MCG_S & MCG_S_IREFST_MASK) != 0x00U) " //Check that the source of the FLL reference clock is the external reference clock., this is why?
Hi
Try modifying the setting for
MCG_C2 to either have the MCG_C2_HGO set or fnot (high gain crystal mode or low gain crystal mode).
This depends on the HW design - if the crystal has a parallel resistor and loading capacitors MCG_C2_HGO is needed for it to start but otherwise it should not be used so that it starts.
Regards
Mark
Hi junwang,
I am using KDS3.2 with Processor Expert, please refer below setting.
If the program still halts, please observe the waveform of XTAL0 and EXTAL0 pins by using oscilloscope.
Make sure the crystal circuit is well soldered.
Best Regards,
Robin
Hi Jun,
most probably you do not have initilaize OSC module. It is required have it properly initialized to be able to enter PEE mode of MCG.
regards
R.