8-bit PIC® MCU External Clock Oscillator Mode
The External Clock Oscillator mode allows the PIC® MCU to run from an externally generated logic level signal. That signal is 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 the "Configuration Settings" section).
The EC mode is selected in a configuration register and has three power modes to select from. The three modes include:
- ECH - High-power mode, 4 Mhz - 32 Mhz
- 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.