
Rev. 1.00
215 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
13 Comparator (CMP) (HT32F54243/HT32F54253 only)
13 Comparator (CMP) (HT32F54243/HT32F54253 only)
Functional Descriptions
Comparator Inputs and Output
The I/O pins used as comparator input or output must be configured in the AFIO controller
registers. The detailed comparator input and output information will be referred in pin assignment
table in the datasheet. The output can also be internally connected to a variety of timers or ADC for
trigger purpose. The comparator output can simultaneously be used for both internal and external
functions.
Comparator Voltage Reference
The comparator voltage reference is a 256-tap resistor ladder network that provides a selectable
reference voltage. A block diagram of the comparator voltage reference is shown in the figure
above. It also has a power-down function to conserve power when the reference is not used. The
comparator voltage reference provides 256 distinct levels. The equation used to calculate the value
of the reference voltage is as follows:
V
CVR
= CVRVAL
× (V
RP
- V
SSA
) / 255
R
R
R
R
R
R
R
256
:1 Mux
CVREN
CVRVAL[7:0]
V
DDA
V
REF
CVRSS = 0
CVRSS = 1
V
CVR
V
RP
Figure 36. Comparator Voltage Reference Block Diagram
The supply voltage V
RP
can come from either the V
DDA
or the internal voltage reference V
REF
by configuring the CVRSS bit in the Comparator Control Register CMPCRn. The CVR output
V
CVR
is used to provide a reference voltage for the analog comparator. It can be internally used or
configured to connect
to the
CN pin by setting the CVROE bit in the Comparator Control Register
CMPCRn
. The settling time of the comparator voltage reference must be considered when the V
CVR
output voltage is changed.