8-bit PIC® MCU External Clock Oscillator Mode

Last modified by Microchip on 2023/11/22 16:33

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).

external clock oscillator mode

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.

config register 1

bit settings for external oscillator

The CLKOUTEN bit is also in a configuration register and typically in the same register as the Fosc bits.

config register 1

bit 11 explained

Tip:

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 PIC MCU Oscillator Options" page. Type your information message here.