
APPLICATION NOTE 78
030998 12/27
CLOCK CONTROL AND STATUS BIT SUMMARY
Table 3
BIT
NAME
LOCATION
FUNCTION
RESET
WRITE ACCESS
XT/RG
EXIF.3
Crystal/Ring Clock Source Select.
0= Select ring oscillator as clock source.
1= Select crystal or external clock as clock
source.
1
0 anytime;
1 when XTUP=1
and XTOFF=0
RGMD
EXIF.2
Ring Oscillator Mode Status.
0= Crystal or external clock is current clock
source.
1= Ring oscillator is current clock source.
0
None
RGSL
EXIF.1
Ring Oscillator Select, Stop Mode.
0= Crystal or external clock will be the clock
source when resuming from Stop mode.
1= Ring oscillator will be the clock source
when resuming from Stop mode.
Note: Upon completion of crystal warm up
period, device will switch to clock source
designated by XT/RG bit.
Unchanged
except after pow-
er–on reset, when
it is cleared to 0.
Unrestricted
XTOFF
PMR.3
Crystal Oscillator Disable.
0= Crystal oscillator is enabled.
1= Crystal oscillator is disabled. Device is
operating from ring oscillator.
0
0 anytime;
1 when XT/RG=0
XTUP
STATUS.4
Crystal Oscillator Warm Up Status.
0= Oscillator warm up still in progress.
1= Oscillator warm up complete.
1
None
CRYSTAL OSCILLATOR STARTUP DELAY
When power is applied to a crystal oscillator after a
period of non–operation, a short period of time is
required before the amplitude of the pulse is sufficient to
provide a stable clock source. This can result in missed
or corrupted clock signals, possibly disrupting proces-
sor operation. To ensure a valid clock signal, the
DS87C5x0 uses a crystal startup counter to detect
65,536 oscillations of the external crystal or clock oscil-
lator before allowing the device to resume operation.
This means that devices utilizing slower crystals will
have longer crystal startup times. The crystal startup
counter is more sensitive than the internal clock cir-
cuitry, and uses the count of both bad and good pulses
to determine the warm–up period. The counter value
was chosen to allow the majority of crystals enough time
to stabilize before releasing the device to run off the
external crystal. The counter is reset anytime the
XTOFF bit is cleared.
The status of the crystal startup counter can be deter-
mined by reading the Crystal Oscillator Warm Up Status
Bit, XTUP (STATUS.4). Note that this bit will always be
set upon a power–on reset, because the counter must
time out before the device will resume operation. For the
same reason, this bit will also be set when resuming
from Stop mode with the XT/RG bit set to 1. When
switching from the ring oscillator to the crystal oscillator,
the XTUP bit can be used to tell when the crystal has
stabilized. Attempts to switch to the external crystal
before the XTUP bit has been set will be disregarded.
SWITCHING BETWEEN CLOCK SOURCES
On occasion the device may wish to switch between the
ring oscillator and crystal oscillator. The device can
switch to the ring oscillator at any time as there is no
start up delay associated with the ring oscillator. Clear-
ing the Crystal Oscillator/Ring Oscillator Select Bit,
XT/RG (EXIF.3) will enable the ring oscillator. If there is
no expectation that the crystal oscillator will be needed
soon, the crystal oscillator can be disabled by setting the
Crystal Oscillator Disable Bit, XTOFF (PMR.3). This will
provide a significant power savings. Note that clearing
the XT/RG bit does not automatically disable the crystal
amplifier.