
APPLICATION NOTE 78
030998 13/27
Switching the clock source from the ring oscillator to the
crystal oscillator is more involved due to the startup
delays inherent in the external crystal. The procedure is
as follows:
1. Clear the Crystal Oscillator Disable Bit, XTOFF
(PMR.3) to restart the crystal oscillator.
2. Wait for the Crystal Oscillator Warm Up Status bit,
XTUP (STATUS.4) to be set, indicating that the
external crystal warm up period is complete.
3. Set the Crystal Oscillator/Ring Oscillator Select Bit,
XT/RG (EXIF.3) to select the crystal as the clock
source.
CLOCK SOURCE AFTER RESET
Following a power–on reset, the RGSL bit is cleared and
the XT/RG bit is set. This forces the device to operate
from an external crystal or external clock source,
regardless of the clock source prior to the event. The
crystal startup counter will be reset and begin counting
down, allowing time for the crystal to stabilize before
resuming operation.
In the case of external (hardware) and watchdog resets,
the XT/RG bit will remain unchanged. This allows the
device to continue from the same clock source that was
active before the reset event. Regardless of the state of
the XT/RG bit, the XTOFF bit is cleared following any
reset, which begins the crystal oscillator warm up. If the
crystal will not be used, the appropriate reset routines
should set the XTOFF bit to disable the crystal oscillator
to conserve power.
CLOCK SOURCE AFTER STOP
During Stop mode, internal clocking to the DS87C5x0 is
halted. Upon receipt of an external interrupt or reset, the
device will use the state of the XTOFF, XT/RG, and
RGSL bits prior to entering Stop mode to determine the
state of the ring oscillator and crystal amplifier. The pos-
sible configurations are shown in Table 4.
CLOCK SOURCE AFTER STOP MODE DETERMINATION
Table 4
XT/RG
XTOFF
RGSL
CLOCK SOURCE
WHEN EXITING
STOP MODE
CLOCK SOURCE
AFTER CRYSTAL
WARM–UP PERIOD
STARTUP DELAY
WHEN RESUMING
CRYSTAL
OSCILLATOR
STATUS
0
0
x
Ring Oscillator
Ring Oscillator
No
Oscillator
enabled
0
1
x
Ring Oscillator
Ring Oscillator
No
Oscillator dis-
abled
1
0
0
Crystal Oscillator
Crystal Oscillator
Yes
Oscillator
enabled
1
0
1
Ring Oscillator
Crystal Oscillator
No
Oscillator
enabled
If the clock source before entering Stop mode is the ring
oscillator, the device will resume operation using the
ring oscillator and continue running from the ring oscilla-
tor after the crystal warm–up period. If the device enters
Stop mode running from the crystal oscillator, the Ring
Oscillator Select, Stop Mode bit, RGSL (EXIF.1) deter-
mines the clock source when resuming from Stop mode.
Upon completion of the crystal warm–up period the
device may continue to operate from the ring oscillator,
or may switch to the external crystal or clock source.
This is determined by the state of the XT/RG bit prior to
entering Stop mode.
It should be noted that the crystal amplifier will begin its
warm–up period automatically if the XT/RG bit was set
prior to entering Stop mode. This will happen if the
device was running from the external crystal or external
oscillator, or if it was running from the ring oscillator but
with the crystal amplifier still running. (Although not a
logical choice, this is theoretically possible.) When
resuming from the ring oscillator with the intent to con-
tinue from the ring oscillator, however, starting the crys-
tal warm–up process is unnecessary. To prevent the
crystal warm–up, make sure the device is operating
from the ring oscillator and the XTOFF bit is set before
entering Stop mode.