AT32F421
Series Reference Manual
2022.11.11
Page 326
Rev 2.02
19.6.1 Comparator control and status register 1
(COMP_CTRLSTS)
Bit
Register
Reset value
Type
Description
Bit 31
CMPWP
0x0
rw0c
Comparator write protected
This bit can be written only once. It is set by software
and cleared by system reset. It will latch all the contents
in the CMP_CTRLSTS[31:0] register.
0: CMP_CTRLSTS[31:0] can be read/written
1: CMP_CTRLSTS[31:0] is read-only.
Bit 30
CMPVALUE
0x0
ro
Comparator output value
This bit is read-only.
Bit 29: 24 Reserved
0x00
resd
Kept at its default value.
Bit 23
SCALEN
0x0
rw
Scale voltage enable
0: Scale voltage disabled
(VREFINT44 = VREFINT34 = VREFINT24 =
VREFINT14 = 0V)
1: Scale voltage enabled (CMPEN = 1, CMPINVSEL[2] =
0)
Bit 22
BRGEN
0x0
rw
Voltage bridge enable
0: Voltage bridge disabled, VREFINT44 = VREFINT34 =
VREFINT24 = VREFINT14 = 1.2V (SCALEN = 1,
CMPEN = 1, CMPINMSEL[2] = 0)
1: Voltage bridge enabled, VREFINT44 = 1.2V,
VREFINT34 = 0.9V, VREFINT24 = 0.6V, VREFINT14 =
0.3V (SCALEN = 1, CMPEN = 1, CMPINMSEL[2] = 0)
Bit 21
Reserved
0x0
resd
Kept at its default value.
Bit 20:18
CMPBLANKING
0x0
rw
Comparator blanking source
000: No blanking output
001: TMR1 OC4 as a blanking window source
010: Reserved
011: TMR3 OC3 as a blanking window source
100: TMR15 OC2 as a blanking window source
101: Reserved
110: TMR15 OC1 as a blanking window source
111: Reserved
Bit 17:16
CMPHYST
0x0
rw
Comparator hysteresis
00: No hysteresis
01: Low hysteresis
10: Medium hysteresis
11: High hysteresis
Refer to the electrical characteristics of hysteresis for
details.
Bit 15
CMPP
0x00
rw
Comparator polarity
0: Comparator output value is not inverted
1: Comparator output value is inverted
Bit 14: 13 Reserved
0x0
resd
Kept at its default value.
Bit 12: 10 CMPTAG
0x0
rw
Comparator output target
This field defines the COMP output target.
000: No selection
001: Timer 1 brake input
010: Timer 1input capture 1
011: Timer 1 output compare clear
100: Reserved
101: Reserved
110: Timer 3 input capture 1
111: Timer 3 output compare clear
Bit 9
Reserved
0x0
resd
Kept at its default value.
Bit 8: 7
CMPNINVSEL
0x1
rw
Comparator non-inverting selection
00: PA5
01: PA1 (by default)
10: PA0
11: VSSA
Bit 6:4
CMPINVSEL
0x0
rw
Comparator inverting selection
000: 1/4 VREFINT
001: 1/2 VREFINT
010: 3/4 VREFINT
011: VREFINT