AW32 doesn't work with external crystal

Discussion created by Guest on Jun 28, 2007
Latest reply on Jul 3, 2007 by Mark Hotchkiss
I've got a big problem with AW32. There is a schematics and printed circuit of my project. (Crystal frequency is 14.318 MHz )








And there is only testing program:

Code:
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */

void MCU_init(void){  /* ### MC9S08AW60_64 "Cpu" init code ... */  /*  PE initialization code after reset */  /* Common initialization of the write once registers */  SMCLK &= (unsigned char)~0x17;                       /*  System clock initialization */  ICGC2 = 0x00;                                        while(!ICGS1_ERCS) {                 /* Wait until external reference is not stable */  }  /* Common initialization of the CPU registers */  PTASE = 0xFF;                                        PTBSE = 0xFF;                                        PTCSE |= (unsigned char)0x7F;                                 PTDSE = 0xFF;                                        PTESE = 0xFF;                                        PTFSE = 0xFF;                                        PTGSE |= (unsigned char)0x7F;                                 PTADS = 0x00;                                        PTBDS = 0x00;                                        PTCDS = 0x00;                                        PTDDS = 0x00;                                        PTEDS = 0x00;                                        PTFDS = 0x00;                                        PTGDS = 0x00;                                        /* ### Init_GPIO init code */  PTBDD |= (unsigned char)0x07;                                 /* ### Init_COP init code */  SRS = 0xFF;                                        /* ### Init_TPM init code */  TPM2SC = 0x00;                                        TPM2MOD = 0x8954;                                        (void)(TPM2SC == 0);                                     TPM2SC = 0x4E;                                        /* ### */  asm CLI;                             /* Enable interrupts */} /*MCU_init*/void _Startup(void);void main(void) {  MCU_init(); /* call Device Initialization */  /* include your code here */  PTBD_PTBD0 = 1;  PTBD_PTBD1 = 1;  PTBD_PTBD2 = 1;  for(;;) {    __RESET_WATCHDOG();  /* please make sure that you never leave main */  }}interrupt 0 void isrVreset (void) {  _Startup();}

And there is a problem
while(!ICGS1_ERCS) {                 /* Wait until external reference is not stable */
}
The while loop is looping forever, so this coase overflow of the watchdog and the reset of the microcontroler. I don't know where could be a problem.  :smileysad:

Thank you for help!!!


Outcomes