Hi! I develop an application on microcontroller MC9S08AWxx, this system should work at high (up to 50 degrees) and low temperature with extremely precison timer so I use an external crystal. I can only use a crystal of 16 MHz and the application doesn't run why?
For working with this hardware I can only choose the FBE clock mode, so the init code is
/* ICGC1: HGO=0,RANGE=1,REFS=0,CLKS1=1,CLKS0=0,OSCSTEN=1,LOCD=0,??=0 */ ICGC1= 0x54; /* ICGC2: LOLRE=0,MFD2=0,MFD1=0,MFD0=0,LOCRE=0,RFD2=0,RFD1=0,RFD0=0 */ ICGC2=0x00); while((ICGS1_ERCS==0)){ } here the routine is frozen why?
If you are using a crystal you need REFS=1 (0 is for an oscillator input) If your crystal is above 8MHz you need to use the high gain oscillator (HGO=1)