Clock Output; On-Chip Rc Oscillator Option; Watchdog Oscillator Option - Philips P89LPC938 User Manual

Single-chip microcontroller
Table of Contents

Advertisement

Philips Semiconductors

2.3 Clock output

The P89LPC938 supports a user-selectable clock output function on the XTAL2 /
CLKOUT pin when the crystal oscillator is not being used. This condition occurs if a
different clock source has been selected (on-chip RC oscillator, watchdog oscillator,
external clock input on X1) and if the Real-time Clock is not using the crystal oscillator as
its clock source. This allows external devices to synchronize to the P89LPC938. This
output is enabled by the ENCLK bit in the TRIM register
The frequency of this clock output is
in Idle mode, it may be turned off prior to entering Idle, saving additional power. Note: on
reset, the TRIM SFR is initialized with a factory preprogrammed value. Therefore when
setting or clearing the ENCLK bit, the user should retain the contents of other bits of the
TRIM register. This can be done by reading the contents of the TRIM register (into the
ACC for example), modifying bit 6, and writing this result back into the TRIM register.
Alternatively, the 'ANL direct' or 'ORL direct' instructions can be used to clear or set bit 6
of the TRIM register.

2.4 On-chip RC oscillator option

The P89LPC938 has a TRIM register that can be used to tune the frequency of the RC
oscillator. During reset, the TRIM value is initialized to a factory pre-programmed value to
adjust the oscillator frequency to 7.373 MHz ± 1 %. (Note: the initial value is better than
1 %; please refer to the P89LPC938 data sheet for behavior over temperature). End user
applications can write to the TRIM register to adjust the on-chip RC oscillator to other
frequencies. Increasing the TRIM value will decrease the oscillator frequency.
Table 5:
On-chip RC oscillator trim register (TRIM - address 96h) bit allocation
Bit
7
Symbol
RCCLK
Reset
0
Table 6:
On-chip RC oscillator trim register (TRIM - address 96h) bit description
Bit
Symbol
0
TRIM.0
1
TRIM.1
2
TRIM.2
3
TRIM.3
4
TRIM.4
5
TRIM.5
6
ENCLK
7
RCCLK

2.5 Watchdog oscillator option

The watchdog has a separate oscillator which has a frequency of 400 kHz. This oscillator
can be used to save power when a high clock frequency is not needed.
User manual
6
5
ENCLK
TRIM.5
0
Bits 5:0 loaded with factory stored value during reset.
Description
Trim value. Determines the frequency of the internal RC oscillator. During reset,
these bits are loaded with a stored factory calibration value. When writing to either
bit 6 or bit 7 of this register, care should be taken to preserve the current TRIM value
by reading this register, modifying bits 6 or 7 as required, and writing the result to
this register.
CCLK
when = 1,
being used.
when = 1, selects the RC Oscillator output as the CPU clock (CCLK). This allows for
fast switching between any clock source and the internal RC oscillator without
needing to go through a reset cycle.
Rev. 03 — 7 June 2005
1
that of the CCLK. If the clock output is not needed
2
4
3
TRIM.4
TRIM.3
is output on the XTAL2 pin provided the crystal oscillator is not
2
UM10119
P89LPC938 User manual
2
1
TRIM.2
TRIM.1
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
0
TRIM.0
20 of 139

Advertisement

Table of Contents
loading

Table of Contents