
Rev. 1.00
73 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
6 Clock Control Unit (CKCU)
The HSE crystal oscillator can be switched on or off using the HSEEN bit in the Global Clock
Control Register (GCCR). The HSERDY flag in the Global Clock Status Register (GCSR) will
indicate if the high-speed external crystal oscillator is stable. While switching on the HSE, the HSE
clock will still not be released until this HSERDY bit is set by the hardware. The specific delay
period is well-known as “Start-up time”. The HSE clock can then be used directly as the system
clock source.
High Speed Internal RC Oscillator – HSI
The high speed internal RC oscillator (HSI) is the default selection of clock source for the CPU when
the device is powered up. The HSI RC oscillator provides a clock source in a lower cost because no
external components are required. The HSI RC oscillator can be switched on or off using the HSIEN
bit in the Global Clock Control Register (GCCR). The HSIRDY flag in the Global Clock Status
Register (GCSR) will indicate if the internal RC oscillator is stable. The start-up time of HSI is shorter
than the HSE crystal oscillator.
The accuracy of the frequency of the high speed internal RC oscillator HSI can be calibrated via the
configuration options, but it is still less accurate than the HSE crystal oscillator. The applications, the
environments and the cost will determine the use of the oscillators.
Software could configure the PSRCEN bit (Power Saving Wakeup RC Clock Enable) to 1 to force HSI
clock to be system clock when wake-up from Deep-Sleep1/2 mode. Subsequently, the system clock is
back to the original clock source if the original clock source ready flag is asserted. This function can
reduce the wakeup time when using HSE as system clock.
Auto Trimming of High Speed Internal RC Oscillator – HSI
The frequency accuracy of the high speed internal RC oscillator HSI can vary from one chip to
another due to manufacturing process variations, this is why each device is factory calibrated
by HOLTEK for ±2 % accuracy at V
DD
= 5 V and T
A
= 25˚C. But the accuracy is not enough for
some applications and environments requirement. Therefore, this device provides the trimming
mechanism for HSI frequency calibration using more accurate external reference clock. The
detailed block diagram is shown as Figure 15.
After reset, the factory trimming value is loaded in the HSICOARSE[4:0] and HSIFINE[7:0] bits
in the HSI Control Register (HSICR). The HSI frequency accuracy may be affected by voltage or
temperature variations. If the application has to be driven by a more accurate HSI frequency, users
can trim manually the HSI frequency using the HSIFINE[7:0] bits in the HSI Control Register
(HSICR) or automatically adjust the HSI frequency using the Auto Trimming Controller (ATC)
together with an external reference clock in the application. The reference clock can be provided
form the following clock sources:
▄
32,768 Hz low speed external crystal or ceramic resonator oscillator LSE output clock
▄
External pin (CKIN) with 1 kHz pulse