Z8 Encore! XP® 4K Series
Product Specification
181
Table 111. Oscillator Configuration and Selection
Clock Source
Characteristics
Required Setup
Internal Precision
RC Oscillator
• 32.8 KHz or 5.53 MHz
• High accuracy when trimmed
• No external components required
• Unlock and write Oscillator Control
Register (OSCCTL) to enable and
select oscillator at either 5.53 MHz or
32.8 KHz
External Crystal/
Resonator
• 32 KHz to 20 MHz
• Very high accuracy (dependent on
crystal or resonator used)
• Configure Flash option bits for correct
external oscillator mode
• Unlock and write OSCCTL to enable
crystal oscillator, wait for it to stabilize
and select as system clock (if the
XTLDIS option bit has been de-
asserted, no waiting is required)
• Requires external components
External RC
Oscillator
• 32 KHz to 4 MHz
• Accuracy dependent on external
components
• Configure Flash option bits for correct
external oscillator mode
• Unlock and write OSCCTL to enable
crystal oscillator and select as system
clock
External Clock
Drive
• 0 to 20 MHz
• Accuracy dependent on external clock
source
• Write GPIO registers to configure PB3
pin for external clock function
• Unlock and write OSCCTL to select
external system clock
• Apply external clock signal to GPIO
Internal Watchdog
Timer Oscillator
• 10 KHz nominal
• Enable WDT if not enabled and wait
• Low accuracy; no external components until WDT Oscillator is operating.
required
• Low power consumption
• Unlock and write Oscillator Control
Register (OSCCTL) to enable and
select oscillator
Unintentional accesses to the oscillator control register can actually stop the chip by
switching to a non-functioning oscillator. To prevent this condition, the oscillator con-
trol block employs a register unlocking/locking scheme.
Caution:
OSC Control Register Unlocking/Locking
To write the oscillator control register, unlock it by making two writes to the OSCCTL
register with the values E7Hfollowed by 18H. A third write to the OSCCTL register
changes the value of the actual register and returns the register to a locked state. Any other
sequence of oscillator control register writes has no effect. The values written to unlock
the register must be ordered correctly, but are not necessarily consecutive. It is possible to
write to or read from other registers within the unlocking/locking operation.
PS022815-0206
Oscillator Control