rfPIC12F675
DS70091A-page 58
Preliminary
2003 Microchip Technology Inc.
10.2.3
EXTERNAL CLOCK IN
For applications where a clock is already available
elsewhere, users may directly drive the rfPIC12F675
provided that this external clock source meets the AC/
DC
timing
requirements
listed
in
should be configured.
10.2.4
RC OSCILLATOR
For applications where precise timing is not a require-
ment, the RC oscillator option is available. The
operation and functionality of the RC oscillator is
dependent upon a number of variables. The RC
oscillator frequency is a function of:
Supply voltage
Resistor (R
EXT) and capacitor (CEXT) values
Operating temperature
The oscillator frequency will vary from unit to unit due
to normal process parameter variation. The difference
in lead frame capacitance between package types will
also affect the oscillation frequency, especially for low
C
EXT values. The user also needs to account for the
tolerance of the external R and C components.
connected.
Two options are available for this Oscillator mode
which allow GP4 to be used as a general purpose I/O
or to output F
OSC/4.
FIGURE 10-3:
RC OSCILLATOR MODE
10.2.5
INTERNAL 4 MHZ OSCILLATOR
When calibrated, the internal oscillator provides a fixed
4
MHz
(nominal)
system
clock.
See
Electrical
Specifications,
for
information
on
variation over voltage and temperature.
Two options are available for this Oscillator mode
which allow GP4 to be used as a general purpose I/O
or to output F
OSC/4.
10.2.5.1
Calibrating the Internal Oscillator
A calibration instruction is programmed into the last
location of program memory. This instruction is a
RETLW XX
, where the literal is the calibration value.
The literal is placed in the OSCCAL register to set the
demonstrates how to calibrate the internal oscillator.
For best operation, decouple (with capacitance) V
DD
and V
SS as close to the device as possible.
EXAMPLE 10-1:
CALIBRATING THE
INTERNAL OSCILLATOR
10.2.6
CLKOUT
The rfPIC12F675 devices can be configured to provide
a clock out signal in the INTOSC and RC oscillator
modes. When configured, the oscillator frequency
divided by four (F
OSC/4) is output on the GP4/OSC2/
CLKOUT pin. F
OSC/4 can be used for test purposes or
to synchronize other logic.
Note:
The microcontroller oscillator is indepen-
dent of the RF peripheral oscillator. An
accurate time-base is still possible with
only one crystal. Use the RF crystal on
transmitter and tie the REFCLK signal
back into T0CKI or T1CKI to correct the
RC, INTOSC, or EC clocks. Since REF-
CLK is only active when RFEN=1, it is not
a suitable source for CLKIN.
GP4/OSC2/CLKOUT
C
EXT
V
DD
R
EXT
V
SS
PIC12F629/675
GP5/OSC1/
F
OSC/4
Internal
Clock
CLKIN
Note:
Erasing the device will also erase the pre-
programmed internal calibration value for
the internal oscillator. The calibration value
must be saved prior to erasing part as
specified in the rfPIC12F675 Programming
specification.
Microchip
Development
Tools maintain all calibration bits to factory
settings.
bsf
STATUS, RP0
;Bank 1
call
3FFh
;Get the cal value
movwf
OSCCAL
;Calibrate
bcf
STATUS, RP0
;Bank 0