39.5.2.1 Comparator Configuration

Each individual comparator must be configured by its respective Comparator Control register (COMPCTRLx) before that comparator is enabled. These settings cannot be changed while the comparator is enabled.

  • Select the desired measurement mode with COMPCTRLx.SINGLE. See Starting a Comparison for more details.
  • Select the desired hysteresis with COMPCTRLx.HYST. See Input Hysteresis for more details.
  • Write COMPCTRLx.SPEED.
  • Select the interrupt source with COMPCTRLx.INTSEL.
  • Select the positive and negative input sources with the COMPCTRLx.MUXPOS and COMPCTRLx.MUXNEG bits. See Selecting Comparator Inputs for more details.
  • Select the filtering option with COMPCTRLx.FLEN
  • Select standby operation with Run in Standby bit (CTRLA.RUNSTDBY) and (COMPCTRLx.AC_RUNSTDBY)

The individual comparators are enabled by writing a '1' to the Enable bit in the COMPENABLE.ENABLEx. The individual comparators are disabled by writing a '0' to COMPENABLE.ENABLEx. Writing a '0' to CTRLA.ENABLE will also disable all the comparators, but will not clear their COMPCTRLx.ENABLE bits.