Philips P89LPC902 Light Therapy Device User Manual


 
Philips Semiconductors
User’s Manual - Preliminary -
P89LPC901/902/903
CLOCKS
2003 Dec 8 28
Figure 2-1: Using the Crystal Oscillator - P89LPC901
Oscillator Option Selection- P89LPC901
The oscillator option is selectable either by the FOSC2:0 bits in UCFG1 or by the RTCS1:0 bits in RTCCON. If the FOSC2:0 bits
select an OSCCLK source of either the internal RC oscillator or the WDT oscillator, then the RTCS1:0 bits will select the oscillator
option for the crystal oscillator. Otherwise, the crystal oscillator option is selected by FOSC2:0. See Table 6-1 and Table 6-2.
Clock Output - P89LPC901
The P89LPC901 supports a user selectable clock output function on the XTAL2 / CLKOUT pin when no crystal oscillator is being
used. This condition occurs if another 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 P89LPC901. This output is enabled by the ENCLK bit in the TRIM register
The frequency of this clock output is 1/2 that of the CCLK. If the clock output is not needed 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 bits 5:0 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.
On-Chip RC oscillator Option
The P89LPC901/902/903 has a 6-bit field within the 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 datasheet 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.
P89LPC901
Quartz crystal or
ceramic resonator
The oscillator must be configured in
one of the following modes:
- Low Frequency Crystal
- Medium Frequency Crystal
- High Frequency Crystal
* A series resistor may be required to limit
crystal drive levels. This is especially
important for low frequency crystals.
*
XTAL1
XTAL2