Product Specs

Table Of Contents
38 COMP Comparator
Page
396
VIN+
t
Figure 114: Hysteresis example where VIN+ starts above VUP
38.4 Pin configuration
The user can use the PSEL register to select one of the analog input pins, AIN0 through AIN7, as input VIN
+.
See Figure 112: Comparator in single-ended mode on page 395. Similarly the user can use the
EXTREFSEL register to select one of the AINx analog input pins as reference input, in case AREF is
selected in REFSEL. The selected analog pins will be acquired by the COMP when it is enabled via the
ENABLE register.
Depending on the device, not all the analog inputs may be available for each MUX. See PSEL and
EXTREFSEL register definition for more information about which analog pins are available on a particular
device.
38.5 Registers
Table 91: Instances
Base address
Peripheral
Instance
Description
Configuration
0x40013000
COMP
COMP
General purpose comparator
Table 92: Register Overview
Register
Offset
Description
TASKS_START
0x000
Start comparator
TASKS_STOP
0x004
Stop comparator
TASKS_SAMPLE
0x008
Sample comparator value
EVENTS_READY
0x100
COMP is ready and output is valid
EVENTS_DOWN
0x104
Downward crossing
EVENTS_UP
0x108
Upward crossing
EVENTS_CROSS
0x10C
Downward or upward crossing
SHORTS
0x200
Shortcut register
INTEN
0x300
Enable or disable interrupt
INTENSET
0x304
Enable interrupt
VUP
VDOWN
ABOVE (VIN+ > VIN-)
BELOW ( VIN+ < VIN-)
ABOVE (VIN+ > VIN-)
BELOW
VDOWN
VUP
VDOWN
VUP
ABOVE
BELOW
ABOVE
1
2
3
CPU
RESULT
VIN-
Output
START
READY
DOWN
SAMPLE
UP
SAMPLE
DOWN