The External Clock Oscillator mode allows the PIC® MCU to be run from an externally generated logic level signal and that signal used as the system clock source. When this mode is selected, the signal is fed into the OSC1 pin. The OSC2 pin is then available to clock out that same clock signal or to be used as a general purpose I/O pin. The system clock is always designated as Fosc in PIC® MCU data sheets. The instruction clock is derived from the Fosc through a divider to deliver an instruction clock of Fosc/4.
The instruction clock can be exported through the OSC2 pin if the CLKOUTEN bit is set in a configuration word (shown in section below).
The EC mode has three power modes to select from. The EC mode is selected in a configuration register. The three modes include:
- ECH - High-power mode, 4Mhz - 32Mhz
- ECM - Medium-power mode, 0.5 Mhz - 4 Mhz
- ECL - Low-power mode, under 0.5 Mhz
Oscillator Start-Up
The Oscillator Start-up Timer (OST) is a delay built into the PIC® MCU device to allow the oscillator to stabilize. The OST senses or counts 1024 oscillations from the crystal or resonator into the OSC1 pin.
The OST is disabled when EC mode is selected. Therefore, there is no delay in operation after a Power-on Reset (POR) or wake-up from Sleep. Because the PIC® MCU design is fully static, stopping the external clock input, while maintaining power, will have the effect of halting the device while leaving all data intact. Upon restarting the external clock, the device will resume operation as if no time had elapsed.
Configuration Settings
The External RC Oscillator is selected with the Fosc bits in a configuration register.
The CLKOUTEN bit is also in a configuration register and typically in the same register as the Fosc bits.
Note: On older devices the clock out option may not be available for the external clock and the OSC2 pin will default to a general purpose I/O pin.
For more information on 8-Bit oscillator options visit the 8-Bit Oscillator Options wiki page.