6 switching between clock sources, Using the ring oscillator, Table 7-e. clock control and status bit summary – Maxim Integrated High-Speed Microcontroller User Manual
Page 101

High-Speed Microcontroller User’s Guide
Rev: 062210
101 of 176
7.3.6 Switching Between Clock Sources
DS87C520 and DS87C530 incorporate the ability to run the device from the ring oscillator after the
crystal warmup period has elapsed. Immediately following a reset (including initial power-up), all devices
must operate from an external crystal or oscillator. At this point, software may switch to the ring
oscillator by clearing the XT/
RG
.3). 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
(
.3). Note that switching to the ring oscillator does not automatically disable the crystal amplifier,
and thus it is possible to be operating the device from the ring oscillator and have the external crystal
amplifier operating at the same time. In some cases this may be desired to take advantage of the low-
frequency, low-power feature of the ring oscillator but still have the capability of quickly switching back
to the external crystal to perform timing or serial port operations.
Switching from the ring oscillator to the crystal oscillator is more involved due to the startup delays
inherent in the external crystal. To prevent an accidental disabling of the device, the XTUP bit must be set
by internal hardware (indicating an enabled, stable crystal) before setting the XT/
RG
bit. The procedure to
switch to the crystal oscillator when running from the ring oscillator is as follows:
1) Clear the crystal oscillator disable bit, XTOFF (
.3) to restart the crystal oscillator and start the
crystal warmup period.
2) Wait for the crystal oscillator warmup status bit, XTUP (
.4) to be set, indicating that the
external crystal warmup period is complete. This will take 65,536 external clock cycles.
3) Set the crystal oscillator/ring oscillator select bit, XT/
RG
.3) to select the crystal as the clock
source.