Datasheet

© 2008 Microchip Technology Inc. DS41249E-page 27
PIC16F785/HV785
3.4 Internal Clock Modes
The PIC16F785/HV785 has two independent, internal
oscillators that can be configured or selected as the
system clock source.
1. The HFINTOSC (High-frequency Internal Oscil-
lator) is factory calibrated and operates at
8 MHz. The frequency of the HFINTOSC can be
user adjusted ±12% via software using the
OSCTUNE register (Register 3-1).
2. The LFINTOSC (Low-frequency Internal
Oscillator) is uncalibrated and operates at
approximately 31 kHz.
The system clock speed can be selected via software
using the Internal Oscillator Frequency Select (IRCF)
bits.
The system clock can be selected between external or
internal clock sources via the System Clock Selection
(SCS) bit (see Section 3.5 “Clock Switching”).
3.4.1 INTRC AND INTRCIO MODES
The INTRC and INTRCIO modes configure the internal
oscillators as the system clock source when the device
is programmed using the Oscillator Selection (FOSC)
bits in the Configuration Word (Register 12-1).
In INTRC mode, the OSC1 pin is available for general
purpose I/O. The OSC2/CLKOUT pin outputs the
selected internal oscillator frequency divided by 4. The
CLKOUT signal may be used to provide a clock for
external circuitry, synchronization, calibration, test or
other application requirements.
In INTRCIO mode, the OSC1 and OSC2 pins are
available for general purpose I/O.
3.4.2 HFINTOSC
The High-frequency Internal Oscillator (HFINTOSC) is
a factory calibrated 8 MHz internal clock source. The
frequency of the HFINTOSC can be altered
approximately ±12% via software using the OSCTUNE
register (Register 3-1).
The output of the HFINTOSC connects to a postscaler
and multiplexer (see Figure 3-1). One of seven
frequencies can be selected via software using the
IRCF bits (see Section 3.4.4 “Frequency Select Bits
(IRCF)”).
The HFINTOSC is enabled by selecting any frequency
between 8 MHz and 125 kHz (IRCF 000) as the
system clock source (SCS = 1) or when Two-Speed
Start-up is enabled (IESO = 1 and IRCF 000).
The HF Internal Oscillator (HTS) bit, in the OSCCON
Register, indicates whether the HFINTOSC is stable or
not.
3.4.2.1 Calibration Bits
The 8 MHz High-frequency Internal Oscillator (HFIN-
TOSC) is factory calibrated. The HFINTOSC calibra-
tion bits are stored in the Calibration Word (CALIB)
located in program memory location 2008h. The Cali-
bration Word is not erased using the specified bulk
erase sequence in thePIC16F785/HV785 Memory
Programming Specification” (DS41237) and does not
require reprogramming. Reference thePIC16F785/
HV785 Memory Programming Specification
(DS41237) for more information on the Calibration
Word register.
Note: Address 2008h is beyond the user program
memory space. It belongs to the special
Configuration Memory space (2000h-
3FFFh), which can be accessed only during
programming. See “PIC16F785/HV785
Memory Programming Specification
(DS41237) for more information.