Clock Functions
68HC912DG128 Rev 1.0
150
Clock Functions
MOTOROLA
clock monitor is forced to be enabled. The MCU goes into limp-home
mode and the VCO supplies the limp-home clock frequency to the
13-stage counter with XCLK. The BCSP output is forced high, MCS is
forced low, and BCLK and MCLK are forced to be PCLK, which is also
supplied by VCO.
A normal STOP exit sequence with a crystal oscillator requires a set DLY
bit to allow for crystal oscillator stabilization. After a count of 4096
X clock cycles at the limp-home frequency, if the clock monitor indicates
the presence of an external clock, the limp-home mode is de-asserted
and the MCU exits STOP normally, using EXTALi clock. In the case of
crystal start-up time being longer than the initial count of 4096 XCLK
cycles, or in the absence of an external clock, the MCU recovers from
STOP in limp-home mode, with both LHOME flag set and LHIF
limp-home interrupt request set, to indicate it is not operating at the
desired frequency. Each time the 13-stage counter reaches a count of
4096 XCLK cycles, a check of the clock monitor status is performed.
When the presence of an external clock is detected, the LHOME flag is
cleared. This sets the limp-home interrupt flag and if enabled by the
LHIE bit, the limp-home mode interrupt is requested.
It is also possible to exit STOP with DLY bit cleared, using a crystal
oscillator. In this case, STOP is de-asserted without delay and the MCU
can execute software in limp-home mode, until the crystal oscillator has
started and is stable. This is called “Fast STOP recovery”. In this case,
after a count of 4096 XCLK cycles at the limp-home frequency, if the
clock monitor indicates the presence of an external clock, the limp-home
mode is de-asserted and the LHOME flag is cleared. This also sets the
limp-home interrupt flag. Upon leaving limp-home mode, BCSP and
MCS are restored to their values before the loss of clock, and XCLK,
BCLK and MCLK return to their previous frequencies. If AUTO and
BCSP were set before the clock loss, the sysclk ramps-up and the PLL
locks at the previously selected frequency. To prevent PLL operation
when the external clock frequency comes back, the software should
clear the BCSP bit while running in limp-home mode.
It is possible to exit STOP with DLY bit cleared, when an external clock
is supplied. In this case the LHOME flag is never set and STOP is
de-asserted without delay.
12-clock