Datasheet

PIC16F818/819
DS39598C-page 36 Preliminary 2002 Microchip Technology Inc.
4.5.1 INTRC MODES
Using the internal oscillator as the clock source can
eliminate the need for up to two external oscillator pins,
which can then be used for digital I/O. Two distinct
configurations are available:
In INTIO1 mode, the OSC2 pin outputs F
OSC/4,
while OSC1 functions as RA7 for digital input and
output.
In INTIO2 mode, OSC1 functions as RA7 and
OSC2 functions as RA6, both for digital input and
output.
4.5.2 OSCTUNE REGISTER
The internal oscillator’s output has been calibrated at
the factory, but can be adjusted in the user's applica-
tion. This is done by writing to the OSCTUNE register
(Register 4-1). The tuning sensitivity is constant
throughout the tuning range. See Section 15.0
(“Electrical Characteristics”) for further details.
When the OSCTUNE register is modified, the INTOSC
frequency will begin shifting to the new frequency. The
INTOSC clock will reach the new frequency within
8 clock cycles (approximately 8 * 32 µs=256µs).
Code execution continues during this shift; there is no
indication that the shift has occurred. Operation of fea-
tures that depend on the 31.25 kHz INTRC clock
source frequency, such as the WDT and peripherals,
will also be affected by the change in frequency.
REGISTER 4-1: OSCTUNE: OSCILLATOR TUNING REGISTER
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
TUN5 TUN4 TUN3 TUN2 TUN1 TUN0
bit 7 bit 0
bit 7-6 Unimplemented: Read as ‘0’
bit 5-0 TUN<5:0>: Frequency Tuning bits
011111 = Maximum frequency
011110 =
000001 =
000000 = Center frequency. Oscillator Module is running at the calibrated frequency.
111111 =
100000 = Minimum frequency
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown