MC13213 locking  to external clock

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC13213 locking  to external clock

1,281 Views
Thomas_H
Contributor I
Hello,

I am stuck here with a problem by switching the controller in the MC13213 to the external clock mode with FLL engaged, FEE mode. The device wont lock to the external supplied 32,786kHz clock.

here is my initialiazation code:
Code:
ICGC1_RANGE = 0;        /* range low. */ICGC1_OSCSTEN = 1;      /* Osc enabled in off mode. */ICGC1_REFS = 0;         /* interal ref off  */ICGC1_CLKS1 = 1;ICGC1_CLKS0 = 1;        /*FEE external ref fll engaged */   while (!ICGS1_ERCS)    /* Wait for external reference to be stable. */    __RESET_WATCHDOG();  while (!ICGS2_DCOS)    /* Wait for external reference to be stable. */        __RESET_WATCHDOG();
and the controller allways stucks at:
while (!ICGS1_ERCS)
 the second while loop would be passed if the first is disabled. But anyway if I do so the clocking result is far from the expected behavior. The supplied external clock is stable and the shematic looks like the suggested in the datasheet with CLKO connected to EXTAL and XTAL n.c.

regards
thomas


Labels (1)
0 Kudos
Reply
1 Reply

639 Views
Thomas_H
Contributor I
OK. I've found the problem already.
The CLKS bits have to be set at once otherwise the CPU may be stuck at internal clock and can't switch to external clock until next reset.

regards
thomas
0 Kudos
Reply