![CMOSTEK NextGenRF CMT2189B Скачать руководство пользователя страница 59](http://html1.mh-extra.com/html/cmostek/nextgenrf-cmt2189b/nextgenrf-cmt2189b_user-manual_2627491059.webp)
AN201
Rev 1.5 | 59/91
www.cmostek.com
5.4.1 System Clock Selection bit (SCS)
The System Clock Selection bit (SCS) of the OSCCON register selects the system clock sources used for the CPU and
peripherals.
When the system clock selection bit (SCS) of the OSCCON register is 0, the system clock source is determined by
configuration of the FOSC<2:0> bit in the configuration word register (UCFG0).
When the system clock selection bit (SCS) of the OSCCON register is 1, the system clock source is selected according to
the internal oscillator frequency selected by the IRCF<2:0> bit of the OSCCON register. SCS is always cleared after a
reset,.
Notes:
1.
Any clock switching caused by hardware (possibly from two-speed start-up or fail-safe clock monitor) will not update the
SCS bit of the OSCCON register. Users should monitor the OSTS bit of the OSCCON register to determine the current
system clock source.
5.4.2 Oscillator Start-up Timeout State (OSTS) Bit
The oscillator start-up timeout state (OSTS) bit of the OSCCON register is used to indicate whether the system clock is from the
external clock source or the internal clock source. The external clock source is defined by the FOSC<2:0> bit in the configuration
word register (UCFG0). OSTS also indicates whether the oscillator start-up timer (OST) is timeout in the LP or XT mode.
5.5 Two-Speed Clock Start-up Mode
The two-speed start-up mode reduces the power consumption further by minimizing the latency between the external oscillator
and the code execution. For applications using the sleep mode frequently, the two-speed start-up mode removes the external
oscillator start-up time after a device wakes up thus reducing the overall power consumption of the device. This mode allows an
application to execute several instructions using INTOSC as the clock source then enter sleep again with no need to wait for the
startup of the main oscillator.
Notes:
1.
Executing a SLEEP instruction will abort the oscillator start-up time and clear the OSTS bit of the OSCCON register.
When the oscillator module is configured as the LP mode or XT mode, the oscillator start-up timer (OST) is enabled. (See Section
5.4.2 for details). OST will suspend the program execution until 1024 oscillations are counted. The two-speed start-up mode
minimizes the delay in code execution by operating from the internal oscillator as OST is counting. When OST count reaches
1024 and the OSTS bit of the OSCCON register is set to 1, the program will switch to the external oscillator.
5.5.1 Two-Speed Start-up Mode Configuration
The two-speed start-up mode is configured by the following settings.
Configure the IESO bit in the Configuration Word register UCFG1 as 1, namely the internal/external switching bit (enable
the two-speed start-up mode).
Configure the SCS bit of the OSCCON register as 0.