AnsweredAssumed Answered

MCG Fails To Lock After MCGC2 Changed

Question asked by ROBERT RITCHEY on Jul 19, 2017
Latest reply on Jul 27, 2017 by ROBERT RITCHEY

I am running on the MCF51JM32 with an external crystal.  If the external crystal fails to start I need to keep running on the internal reference.  My problem is that I change MCGC2 to start the external crystal and if the OSCINIT fails to go true I change MCGC2 back to 0x00 to disable the external oscillator.  When I do this I get a loss of lock and the lock bit goes false. I clear the loss-of-lock but I cannot get the FLL to re-lock to the internal reference.  I have tried re-writing some registers to maybe get the FLL to try to lock again but nothing.  I can tell the FLL is not locked because its running at about 40MHz when I have the internal reference and DRS set to run at 48MHz. 


This is posted in the Coldfire forum but I think it applies to any processor with the MCG.


Anyone know a solution to this?