44.6.2.2 Starting a Comparison

Each comparator channel can be in one of two different measurement modes, determined by the Single bit in the Comparator (n) Control register (COMPCTRLn.SINGLE):

  • Continuous measurement
  • Single-shot

After being enabled, a start-up delay (COMPCTRLn.SUT) is required before the result of the comparison is ready. This start-up time is measured automatically to account for environmental changes, such as temperature or voltage supply level. During the start-up time, the COMP output is not available. For details on how the start-up time is calculated, refer to COMPCTRLn.SUT description.

The comparator can be configured to generate interrupts when the output toggles, when the output changes from '0' to '1' (rising edge), when the output changes from '1' to '0' (falling edge) or at the end of the comparison. An end-of-comparison interrupt can be used with the Single-Shot mode to chain further events in the system, regardless of the state of the comparator outputs. The Interrupt mode is set by the Interrupt Selection bit group in the Comparator Control register (COMPCTRLn.INTSEL). Events are generated using the comparator output state, regardless of whether the interrupt is enabled or not.