Datasheet
Value Name
1
Hysteresis is enabled.
Bits 17:16 – OUT[1:0] Output
These bits configure the output selection for comparator n. COMPCTRLn.OUT can be written only while
COMPCTRLn.ENABLE is zero.
These bits are not synchronized.
Value Name Description
0x0
OFF The output of COMPn is not routed to the COMPn I/O port
0x1
ASYNC The asynchronous output of COMPn is routed to the COMPn I/O port
0x2
SYNC The synchronous output (including filtering) of COMPn is routed to the COMPn I/O
port
0x3
N/A Reserved
Bit 15 – SWAP Swap Inputs and Invert
This bit swaps the positive and negative inputs to COMPn and inverts the output. This function can be
used for offset cancellation. COMPCTRLn.SWAP can be written only while COMPCTRLn.ENABLE is
zero.
These bits are not synchronized.
Value Description
0
The output of MUXPOS connects to the positive input, and the output of MUXNEG connects
to the negative input.
1
The output of MUXNEG connects to the positive input, and the output of MUXPOS connects
to the negative input.
Bits 13:12 – MUXPOS[1:0] Positive Input Mux Selection
These bits select which input will be connected to the positive input of comparator n.
COMPCTRLn.MUXPOS can be written only while COMPCTRLn.ENABLE is zero.
These bits are not synchronized.
Value Name Description
0x0
PIN0 I/O pin 0
0x1
PIN1 I/O pin 1
0x2
PIN2 I/O pin 2
0x3
PIN3 I/O pin 3
Bits 10:8 – MUXNEG[2:0] Negative Input Mux Selection
These bits select which input will be connected to the negative input of comparator n.
COMPCTRLn.MUXNEG can only be written while COMPCTRLn.ENABLE is zero.
These bits are not synchronized.
Value Name Description
0x0
PIN0 I/O pin 0
0x1
PIN1 I/O pin 1
0x2
PIN2 I/O pin 2
0x3
PIN3 I/O pin 3
0x4
GND Ground
SAM D21 Family
AC – Analog Comparators
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40001882D-page 957