AN201
Rev 1.5 | 57/91
www.cmostek.com
5.2 External Clock Mode
5.2.1 EC Mode
The external clock mode allows an external logic level as a system clock source. When working in this mode, the external clock
source is connected to the OSC1 input.
When the EC mode is selected, the oscillator start-up timer (OST) is disabled. Therefore, there is no delay for operations after the
power-on reset (POR) or wake-up from sleep. When the MCU is waken up, the external clock is restarted, and the device is
restored to operate as if it has not stopped.
5.2.2 LP and XT Modes
The LP and XT modes support connecting to quartz crystal resonators or ceramic resonators through OSC1 and OSC2 pins. The
mode selects the low or high gain settings of the internal inverter-amplifier to support various resonator types and speeds.
The LP oscillator mode selects the lowest gain settings of the internal inverter-amplifier. The LP mode consumes less current
than the XT mode. The LP mode is designed only to drive the 32.768 kHz tuning fork based crystals (clock crystal oscillator).
The XT oscillator mode selects the high gain settings of the internal inverter-amplifier.
5.3 Internal Clock Mode
The oscillator mode has 2 independent internal oscillators, which can be configured or selected as the system clock source.
1.
The high frequency internal oscillator(HFINTOSC) is calibrated in factory setting with an operating frequency of 16 MHz.
2.
The low frequency internal oscillator(LFINTOSC) with an operating frequency of 32 kHz is un-calibrated. It supports system
clock speed selection by operating the internal oscillator frequency selection bit IRCF<2:0> of the OSCCON register via
software.
The system clock can be selected from external and internal clock sources via the system clock selection bit (SCS) of the
OSCCON register.
Notes:
1.
The LFMOD of the OSCCON register can select the LFINTOSC as 32 kHz or 256 kHz, however WDT is fixed with 32 kHz,
regardless of the LFMOD value.
5.3.1 Frequency Selection Bit (IRCF)
The output of 16 MHz HFINTOSC and 32 kHz LFINTOSC is connected to the prescaler and multiplexer. The OSCCON register's
internal oscillator frequency selection bit IRCF<2:0> is used to select the frequency output of the internal oscillator. Select 1 of the
following 8 frequencies via the software.
16 MHz
8 MHz
4 MHz (Default value after reset)
2 MHz
1 MHz
500 kHz
250 kHz