Digital Clocks
CY8C24xxx Preliminary Data Sheet
264
Document No. 38-12011 Rev. *E
December 22, 2003
24.1.2
Internal Low Speed Oscillator
The internal low speed oscillator (ILO), or sometimes
referred to as the Sleep Oscillator, is always on unless the
device is operating off a crystal. The ILO is available as a
general clock, but is also the clock source for the sleep and
watchdog timers.
The ILO is discussed in detail in the chapter
“Internal Low
Speed Oscillator (ILO)” on page 67
.
24.1.3
32 kHz Crystal Oscillator
The PSoC may be configured to use an external crystal.
When configured in this way the internal low speed oscillator
is turned off and the crystal becomes the clock source for all
32 kHz clocks.
The Crystal Oscillator is discussed in detail in the chapter
“32 kHz Crystal Oscillator (ECO)” on page 69
.
24.1.4
External Clock
The ability to replace the 24 MHz internal main oscillator
(IMO), as the device master system clock (SYSCLK) with an
externally supplied clock, is a feature in the PSoC mixed sig-
nal arrays.
Pin P1[4] has been chosen as the input pin for the external
clock. This pin was chosen because it is not associated with
any special features such as analog IO, crystal, or In Sys-
tem Serial Programming (ISSP), and it is also not physically
close to either the P1[0] and P1[1] crystal pins.
The user is able to supply an external clock with a frequency
between 1 MHz and 24 MHz. The reset state of the EXT-
CLKEN bit is ‘0’, and therefore, the device always boots up
under control of the IMO. There is no way to start the system
from a reset state with the external clock.
When the EXTCLKEN bit is set, the external clock becomes
the source for the internal clock tree, SYSCLK, which drives
most chip clocking functions. All external and internal sig-
nals, including the 32 kHz clock, whether derived from the
internal low speed oscillator (ILO) or the crystal oscillator,
are synchronized to this clock source.
24.1.4.1
Clock Doubler
One of the blocks driven by the system clock is the clock
doubler circuit that drives the SYSCLKX2 output. This dou-
bled clock, which is 48 MHz when the IMO is the selected
clock, may be used as a clock source for the digital blocks.
When the external clock is selected, the SYSCLKX2 signal
is still available and serves as a doubler for whatever fre-
quency is input on the external clock pin.
Following the spec for the external clock input ensures that
the internal circuitry of the digital blocks, which is clocked by
SYSCLKX2, will meet timing. However, since the doubled
clock is generated from both edges of the input clock, clock
jitter will be introduced if the duty cycle deviates greatly from
fifty percent. Also, the high time of the clock out of the dou-
bler is fixed at 21 ns, so the duty cycle of SYSCLKX2 will be
proportional to the inverse of the frequency, as shown in
Figure 24-2
. Regardless of the input frequency, the high
period of SYSCLKX2 is 21 ns nominal.
Figure 24-2. Operation of the Clock Doubler
24.1.4.2
Switch Operation
Switching between the IMO and the external clock may be
done in firmware at any time and is transparent to the user.
Since all chip resources run on clocks derived from or syn-
chronized to SYSCLK, when the switch is made, analog and
digital functions may be momentarily interrupted.
When a switch is made from the IMO to the external clock,
the IMO may be turned off to save power. This can be done
by setting the IMODIS bit and may be done immediately
after the instruction that sets the EXTCLKEN bit. However,
when switching back from an external clock to the IMO, the
IMODIS bit must be cleared, and a firmware delay imple-
mented. This gives the IMO sufficient start-up time before
the EXTCLKEN bit may be cleared.
Switch timing depends on whether the CPU clock divider is
set for divide by 1, or divide by 2 or greater. In the case
where the CPU clock divider is set for divide by 2 or greater,
as shown in
Figure 24-3
, the setting of the EXTCLKEN bit
occurs shortly after the rising edge of SYSCLK. The
SYSCLK output is then disabled after the next falling edge
of SYSCLK, but before the next rising edge. This ensures a
glitch free transition and provides a full cycle of setup time
from SYSCLK to output disable. Once the current clock
selection is disabled, the enable of the newly selected clock
is double synchronized to that clock. After synchronization,
on the subsequent negative edge, SYSCLK is enabled to
output the newly selected clock.
In the 24 MHz case, as shown in
Figure 24-4
, the assertion
of IOW_ and thus the setting of the EXTCLKEN bit occurs
on the falling edge of SYSCLK. Since SYSCLK is already
low, the output is immediately disabled and therefore, the
setup time from SYSCLK to disable is one-half SYSCLK.
Extenal Clock
SYSCLKX2
21 ns Nomnal