![ARTERY AT32WB415 Series Скачать руководство пользователя страница 367](http://html1.mh-extra.com/html/artery/at32wb415-series/at32wb415-series_reference-manual_2977599367.webp)
AT32WB415
Series Reference Manual
2022.04.13
Page 367
Ver 2.00
21.6 CMP registers
These registers must be accessed by words (32 bits).
Table 21-1 CMP register map and reset values
Register name
Offset
Reset value
CMP_CTRLSTS1
0x00
0x0000 0080
CMP_CTRLSTS2
0x04
0x0001 0001
21.6.1 Comparator control and status register 1 (COMP_CTRLSTS1)
Bit
Register
Reset value
Type
Description
Bit 31
CMP2WP
0x0
rw0c
Comparator 2 write protected
0: Disabled
1: Enabled
Note:
The
COMP_CTRLSTS1[31:16]
and
COMP_CTRLSTS2[31:16] can be write-protected through
this bit. This bit can be cleared through system reset.
Bit 30
CMP2VALUE
0x0
ro
Comparator 2 output value
This bit is read-only, indicating the status of the current
comparator 2 output (affected by the COMP2P bit).
Bit 29:28
CMP2HYST
0x0
rw
Comparator2 hysteresis
00: No hysteresis
01: Low hysteresis
10: Intermediate hysteresis
11: High hysteresis
Please refer to hysteresis electrical characteristics
Bit 27
CMP2P
0x00
rw
Comparator2 polarity
0: Comparator 2 output value is not inverted
1: Comparator 2 output value is inverted
Bit 26:24
CMP2TAG
0x0
rw
Comparator output target
This field controls the COMP2 output target.
000: No selection
001: Timer 1 brake input
010: Timer 1input capture 1
011: Timer 1 output compare clear
100: Timer 2 input capture 4
101: Timer 2 output compare clear
110: Timer 3 input capture 1
111: Timer 3 output compare clear
Bit 23
DCMPEN
0x0
rw
Double comparator mode enable
0: Double comparator mode disabled
1: Double comparator mode enabled
Note: This bit is used to enable dual comparator mode,
connecting the positive input of COMP2 with that of
COMP1.
Bit 22:20
CMP2INVSEL
0x0
rw
Comparator2 inverting selection
000: 1/4 VREFIN
001: 1/2 VREFINT
010: 3/4 VREFINT
011: VREFINT
100: PA4
101: PA5
110: PA2
111: Reserved
Bit 19
Reserved
0x0
resd
Kept at its default value.
Bit 18
CMP2SSEL
0x0
rw
Comparator 2 speed selection
This bit is used to control the operating mode of
comparators in order to adjust speed and power
consumption.
0: Hihg-speed/maximum power consumption
1: Low-speed/minimum power consumption
Bit 17
Reserved
0x0
resd
Kept at its default value.
Bit 16
CMP2EN
0x0
rw
Comparator 2 enable
This bit is used to enable/disable a comparator.
0: Comparator 2 disabled
1: Comparator 2 enabled