Clock Source Types

Clock sources can be classified as external or internal.

External clock sources rely on external circuitry for the clock source to function, such as digital oscillator modules.

Internal clock sources are contained within the oscillator module. The internal oscillator block features two internal oscillators that are used to generate internal system clock sources. The High-Frequency Internal Oscillator (HFINTOSC) can produce a wide range of frequencies which are determined via the HFINTOSC Frequency Selection (OSCFRQ) register. The Low-Frequency Internal Oscillator (LFINTOSC) generates a fixed nominal 31 kHz clock signal. The internal oscillator block also features an RC oscillator (ADCRC) which is dedicated to the Analog-to-Digital Converter (ADC).

Important: The PIC16F152 microcontroller family does not allow the system clock source to be changed through clock switching. Once the RSTOSC Configuration bits select the oscillator source, the source cannot be changed via software. If the HFINTOSC is selected as the clock source, the HFINTOSC frequency may be changed by modifying the FRQ bits.

The instruction clock (FOSC/4) can be routed to the CLKOUT pin when the pin is not in use. The Clock Out Enable (CLKOUTEN) Configuration bit controls the functionality of the CLKOUT signal. When CLKOUTEN is clear (CLKOUTEN = 0), the CLKOUT signal is routed to the CLKOUT pin. When CLKOUTEN is set (CLKOUTEN = 1), the CLKOUT pin functions as an I/O pin.