
December 22, 2003
Document No. 38-12011 Rev. *E
69
10.
32 kHz Crystal Oscillator (
ECO
)
This chapter briefly explains the 32 kHz Crystal Oscillator (ECO) and its associated register. The 32 kHz crystal oscillator cir-
cuit allows the user to replace the internal low speed oscillator with a more precise time source at low cost and low power.
10.1
Architectural Description
The crystal oscillator circuit uses an inexpensive watch crys-
tal and two small valued load capacitors as external compo-
nents. All other components are on the PSoC chip. The
crystal oscillator may be configured to provide a reference to
the internal main oscillator in PLL mode for generating a
more accurate 24 MHz system clock.
The XTALIn and XTALOut pins support connection of a
32.768 kHz watch crystal. To run from the external crystal,
Bit 7 of the Oscillator Control 0 Register (OSC_CR0) must
be set (default is off). The only external components are the
crystal and the two load capacitors that connect to Vdd.
Transitions between the internal and external oscillator
domains may produce glitches on the clock bus.
During the process of activating the ECO, there must be a
hold-off period before using it as the 32 kHz source. This
hold off period is partially implemented in hardware using
the Sleep Timer. Firmware must set up a sleep period of one
second (maximum ECO settling time), and then enable the
ECO in the OSC_CR0 register. At the one second time-out
(the Sleep Interrupt), the switch is made by hardware to the
ECO. If the ECO is subsequently deactivated, the ILO will
again be activated and the switch is made back to the ILO
immediately.
The firmware steps involved in switching between the inter-
nal low speed oscillator to the 32 kHz Crystal Oscillator are
as follows.
1.
At reset, the chip begins operation, using the internal low
speed oscillator.
2.
Select sleep interval of 1 second using bits[4:3] in the
Oscillator Control 0 Register (OSC_CR0), as the oscilla-
tor stabilization interval.
3.
Enable the 32 kHz Crystal Oscillator, by setting bit [7] in
Oscillator Control 0 Register (OSC_CR0) to 1.
4.
The 32 kHz Crystal Oscillator becomes the selected
source, at the end of the one-second interval on the
edge created by the Sleep Interrupt logic. The one-sec-
ond interval gives the oscillator time to stabilize, before it
becomes the active source. The Sleep Interrupt need
not be enabled for the switch-over to occur. Reset the
sleep timer (if this does not interfere with any ongoing
real-time clock operation), to guarantee the interval
length. Note that the internal low speed oscillator contin-
ues to run, until the oscillator is automatically switched
over by the sleep timer interrupt.
5.
It is strongly advised to wait the one-second stabilization
period prior to engaging the PLL mode to lock the Inter-
nal Main Oscillator frequency to the 32 kHz Crystal
Oscillator frequency.
Note 1
instantaneously by writing the 32K Select control bit to zero.
The internal low speed oscillator switches back
Note 2
Designer, the above steps are automatically done in
boot.asm
.
If the proper settings are selected in PSoC
Note 3
duce glitches on the 32K clock bus. Functions that require
accuracy on the 32K clock should be enabled after the tran-
sition in oscillator domains.
Transitions between oscillator domains may pro-
Table 10-1. Crystal Oscillator Register
Address
1,E0h
1,EBh
x,FEh
Name
Bit 7
Bit 6
Bit 5
No Buzz
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Access
RW : 00
W : 00
RW:00
OSC_CR0
ECO_TR
CPU_SCR1
32k Select
PLL Mode
Sleep[1:0]
CPU Speed[2:0]
PSSDC[1:0]
IRAMDIS