Datasheet

© 2008 Microchip Technology Inc. DS41249E-page 23
PIC16F785/HV785
3.0 CLOCK SOURCES
3.1 Overview
The PIC16F785/HV785 has a wide variety of clock
sources and selection features to allow it to be used in
a wide range of applications while maximizing perfor-
mance and minimizing power consumption. Figure 3-1
illustrates a block diagram of the PIC16F785/HV785
clock sources.
Clock sources can be configured from external oscilla-
tors, quartz crystal resonators, ceramic resonators and
Resistor-Capacitor (RC) circuits. In addition, the sys-
tem clock source can be configured from one of two
internal oscillators, with a choice of speeds selectable
via software. Additional clock features include:
Selectable system clock source between external
or internal via software.
Two-Speed Clock Start-up mode, which mini-
mizes latency between external oscillator start-up
and code execution.
Fail-Safe Clock Monitor (FSCM) designed to
detect a failure of the external clock source (LP,
XT, HS, EC or RC modes) and switch to the
internal oscillator.
The PIC16F785/HV785 can be configured in one of
eight clock modes.
1. EC – External clock with I/O on RA4.
2. LP – 32.768 kHz Watch Crystal or Ceramic
Resonator Oscillator mode.
3. XT – Medium Gain Crystal or Ceramic
Resonator Oscillator mode.
4. HS – High Gain Crystal or Ceramic Resonator
mode.
5. RC – External Resistor-Capacitor (RC) with
F
OSC/4 output on RA4
6. RCIO – External Resistor-Capacitor with I/O on
RA4.
7. INTOSC – Internal Oscillator with F
OSC/4 output
on RA4 and I/O on RA5.
8. INTOSCIO – Internal Oscillator with I/O on RA4
and RA5.
Clock Source modes are configured by the
FOSC<2:0> bits in the Configuration Word (see
Section 15.0 “Special Features of the CPU”). Once
the PIC16F785/HV785 is programmed and the Clock
Source mode configured, it cannot be changed in the
software.
FIGURE 3-1: PIC16F785/HV785 CLOCK SOURCE BLOCK DIAGRAM
(CPU and Peripherals)
OSC1
OSC2
Sleep
External Oscillator
LP, XT, HS, RC, RCIO, EC
System Clock
Postscaler
MUX
MUX
8 MHz
4 MHz
2 MHz
1 MHz
500 kHz
125 kHz
250 kHz
IRCF<2:0>
111
110
101
100
011
010
001
000
31 kHz
Power-up Timer (PWRT)
FOSC<2:0>
(Configuration Word)
SCS
(OSCCON<0>)
Internal Oscillator
(OSCCON<6:4>)
Watchdog Timer (WDT)
Fail-Safe Clock Monitor (FSCM)
HFINTOSC
8 MHz
LFINTOSC
31 kHz