
Rev. 1.00
201 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
13 General-Purpose T
imer (GPTM)
Output Stage
The GPTM has four channels for compare match, single pulse or PWM output function. The
channel output GT_CHxO is controlled by the CHxOM, CHxP and CHxE bits in the corresponding
CHxOCFR, CHPOLR and CHCTR registers.
Output Mode
Controller
CHxOM
CHxE
GT_CHxO
CHxCCR
CNTR
CHxOREF
f
CLKIN
CHxCMP Event
Output Enable
Controller
CHxP
CHxOREF
x: 0 ~ 3
Figure 50. Output Stage Block Diagram
Channel Output Reference Signal
When the GPTM is used in the compare match output mode, the CHxOREF signal (Channel x
Output Reference signal) is defined by the CHxOM field setup. The CHxOREF signal has several
types of output function which defines what happens to the output when the counter value matches
the contents of the CHxCCR register. In addition to the low, high and toggle CHxOREF output
types; there are also PWM mode 1 and PWM mode 2 outputs. In these modes, the CHxOREF
signal level is changed according to the count direction and the relationship between the counter
value and the CHxCCR content. There are also two modes which will force the output into an
inactive or active state irrespective of the CHxCCR content or counter values. With regard to a
more detailed description refer to the relative bit definition. The accompanying Table 27 shows a
summary of the output type setup.
Table 27. Compare Match Output Setup
CHxOM Value
Compare Match Level
0x0
No change
0x1
Clear Output to 0
0x2
Set Output to 1
0x3
Toggle Output
0x4
Force Inactive Level
0x5
Force Active Level
0x6
PWM Mode 1
0x7
PWM Mode 2