Clock Controller; Figure 33. Gptm Clock Selection Source - Holtek HT32F52220 User Manual

32-bit microcontroller with arm cortex-m0+ core
Table of Contents

Advertisement

32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F52220/HT32F52230

Clock Controller

The following describes the Timer Module clock controller which determines the clock source of
the internal prescaler counter.
Internal APB clock f
The default internal clock source is the APB clock f
when the slave mode is disabled. When the slave mode selection bits SMSEL are set to 0x4, 0x5
or 0x6, the internal APB clock f
mode controller is enabled by setting SMSEL field in the MDCFR register to an available value
including 0x1, 0x2, 0x3 and 0x7, the prescaler is clocked by other clock sources selected by the
TRSEL field in the TRCFR register and described as follows.
Quadrature Decoder:
To select Quadrature Decoder mode the SMSEL field should be set to 0x1, 0x2 or 0x3 in the
MDCFR register. The Quadrature Decoder function uses two input states of the GT_CH0 and
GT_CH1 pins to generate the clock pulse to drive the counter prescaler. The counting direction
bit DIR is modified by hardware automatically at each transition on the input source signal. The
input source signal can be derived from the GT_CH0 pin only, the GT_CH1 pin only or both
GT_CH0 and GT_CH1 pins.
STIED:
The counter prescaler can count during each rising edge of the STI signal. This mode can be
selected by setting the SMSEL field to 0x7 in the MDCFR register. Here the counter will act
as an event counter. The input event, known as STI here, can be selected by setting the TRSEL
field to an available value except the value of 0x0. When the STI signal is selected as the clock
source, the internal edge detection circuitry will generate a clock pulse during each STI signal
rising edge to drive the counter prescaler. It is important to note that if the TRSEL field is set to
0x0 to select the software UEVG bit as the trigger source, then when the SMSEL field is set to
0x7, the counter will be updated instead of counting.
CLKPULSE
(Quadrature Decoder)
CK_PSC
f
CLKIN
(Internal APB clock)
STIED
(Trigger events)
TRSEL
SMSEL
ECME

Figure 33. GPTM Clock Selection Source

Rev. 1.10
:
CLKIN
is the counter prescaler driving clock source. If the slave
CLKIN
PSCR
CK_CNT
CLK
PSC Prescaler
Reset
Start/Stop
Overflow /
Underflow
180 of 366
used to drive the counter prescaler
CLKIN
CRR
CLK
CNTR
Reset
Slave Restart
UEVG bit
mode trigger
November 09, 2018
Update Event
TM_CNT

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HT32F52220 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Ht32f52230

Table of Contents