HT32 MCU Hardware Development Guideline
XTALIN
XTALOUT
R
f
Crystal
C
C
L1
L2
The following guidelines are provided to improve the stability of the crystal circuit PCB layout.
The crystal oscillator should be located as close as possible to the MCU so that the trace lengths
are kept as short as possible to reduce any parasitic capacitances.
Use a ground plane to shield any circuits near crystal to isolate signals and reduce noise.
Keep frequently switching signal lines away from the crystal area to prevent crosstalk.
The HSE crystal oscillator can be switched on or off by 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. When switching on the HSE, the HSE
clock will not be released immediately for use until the HSERDY bit is set by the hardware. The
specific delay period is well-known as "Start-up time". As the HSE becomes stable, the HSE clock
can then be used directly as the system clock source or as the PLL input clock.
The HSE clock monitor function is enabled by the HSE Clock Monitor Enable bit, CKMEN, in the
Global Clock Control Register, GCCR. This function should be enabled after the HSE oscillator
start-up delay and be disabled when the HSE oscillator is stopped. Once an HSE oscillator failure
is detected, the HSE oscillator will be automatically disabled. The HSE Clock Stuck Flag, CKSF,
in the Global Clock Interrupt Register, GCIR, will be set high. At this moment, if the clock fail
interrupt enable bit, CKSIE, in the GCIR register is high, a clock failure interrupt is generated. This
failure interrupt is connected to the CPU Non-Maskable Interrupt, NMI. If the HSE is directly used
as the system clock, when an HSE oscillator failure occurs, the HSE will be turned off and the
system clock will be switched to the HSI automatically by the hardware. If the HSE is used as the
clock input of the PLL circuit and the system clock is sourced from the PLL circuit output, the PLL
circuit and HSE will be turned off at the same time when the failure happens.
High Speed Internal Oscillator – HSI
The high speed internal RC oscillator, HSI, is the default clock source for the CPU when the device
is powered on. The HSI RC oscillator provides a lower cost clock source because no external
components are required. Compared with the external crystal oscillator, the HSI has a lower
frequency accuracy. The HSI clock frequency and accuracy can be obtained from the HSI
characteristics of the datasheet.
AN0630EN V1.00
5 / 12
December 15, 2022
Need help?
Do you have a question about the HT32 and is the answer not in the manual?