English
Language : 

DS80C320-MCG Datasheet, PDF (103/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
SWITCHING BETWEEN CLOCK SOURCES
DS87C520 and DS87C530 incorporate the ability to run the device from the ring oscillator after the
crystal warm-up 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 bit (EXIF.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
(PMR.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 (PMR.3) to restart the crystal oscillator and start the
crystal warm-up period.
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. This will take 65,536 external clock cycles.
3. Set the Crystal Oscillator/Ring Oscillator Select Bit, XT/ RG (EXIF.3) to select the crystal as the
clock source.
103 of 175