
Rev. 1.00
87 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
6 Clock Control Unit (CKCU)
6 Clock Control Unit (CKCU)
Low Speed Internal RC Oscillator – LSI
The low speed internal RC oscillator with a frequency of about 32 kHz produces a low power clock
source for the circuits of Real-Time-Clock peripheral, Watchdog Timer or system clock. The LSI
is also a low cost clock source because no external component is needed to make it oscillate. The
frequency accuracy of the low speed internal RC oscillator LSI is shown in the corresponding data
sheet. The LSIRDY flag in the Global Clock Status Register (GCSR) will indicate if the LSI clock
is stable.
Clock Ready Flag
The CKCU provides clock ready flags for HSI, HSE, PLL, LSI and LSE to confirm these clocks
are stable before using them as system clock source or other purposes. Software can check specific
clock is ready or not by polling separate clock ready status bits in GCSR register.
System Clock (CK_SYS) Selection
After a system reset occurs, the default source of the system clock CK_SYS will be the high
speed internal RC oscillator HSI. The CK_SYS clock may come from the HSI, HSE, LSE, LSI or
PLL output clock and it can be switched from one clock source to another via the System Clock
Switch field, SW, in the Global Clock Control Register (GCCR). The system will still run under the
original clock until the destination clock gets ready. The corresponding clock ready status bit in the
Global Clock Status Register (GCSR) will indicate whether the selected clock is ready to use or not.
The CKCU also contains the clock source status bits in the Clock Source Status Register (CKST) to
indicate which clock is currently used as the system clock. If a clock source or the PLL output clock
is used as the system clock, it is not possible to stop it. More details about clock enable function are
described below.
If any following action takes effect, the HSI is always under enable state.
▆
Enable PLL and configure its source clock to HSI. (PLLEN, PLLSRC)
▆
Enable Clock monitor. (CKMEN)
▆
Configure clock switch field to select HSI. (SW)
▆
Configure HSI enable bit to 1. (HSIEN)
If any following action takes effect, the HSE is always under enable state.
▆
Enable PLL and configure its source clock to HSE. (PLLEN, PLLSRC)
▆
Configure clock switch field to select HSE. (SW)
▆
Configure HSE enable bit to 1. (HSEEN)
If any following action takes effect, the PLL is always under enable state.
▆
Configure clock switch field to select PLL (SW)
▆
Configure PLL enable bit to 1. (PLLEN)
Programming guide of system clock selection is listed below.
1. Enable any source clock which will become the system clock or PLL input clock.
2. Configure the PLLSRC bit after the ready flags of both HSI and HSE are asserted.
3. Configure the SW field to change the system clock source after the corresponding clock ready
flag is asserted. Note that the system clock will force to HSI if the clock monitor is enabled and
the PLL output clock or HSE clock configured as system clock is stuck at 0 or 1.