CMPnP.0
CMPnP.1
CMPnP.2
CMPnP.3
CMPnP.x
CMPnN.0
CMPnN.1
CMPnN.2
CMPnN.3
CMPnN.x
CMPn+
CMPn-
DAC
DACLVL
CMXP
CMXN
Full Scale
Reference
Figure 13.6. Positive Input DAC Connection
13.3.4 Output Routing
The comparator’s synchronous and asynchronous outputs can optionally be routed to port I/O pins through the port I/O crossbar. The
output of either comparator may be configured to generate a system interrupt on rising, falling, or both edges. CMP0 may also be used
as a reset source or as a trigger to kill a PCA output channel.
The output state of the comparator can be obtained at any time by reading the CPOUT bit. The comparator is enabled by setting the
CPEN bit to logic 1, and is disabled by clearing this bit to logic 0. When disabled, the comparator output (if assigned to a port I/O pin via
the crossbar) defaults to the logic low state, and the power supply to the comparator is turned off.
Comparator interrupts can be generated on both rising-edge and falling-edge output transitions. The CPFIF flag is set to logic 1 upon a
comparator falling-edge occurrence, and the CPRIF flag is set to logic 1 upon the comparator rising-edge occurrence. Once set, these
bits remain set until cleared by software. The comparator rising-edge interrupt mask is enabled by setting CPRIE to a logic 1. The com-
parator falling-edge interrupt mask is enabled by setting CPFIE to a logic 1.
False rising edges and falling edges may be detected when the comparator is first powered on or if changes are made to the hysteresis
or response time control bits. Therefore, it is recommended that the rising-edge and falling-edge flags be explicitly cleared to logic 0 a
short time after the comparator is enabled or its mode bits have been changed, before enabling comparator interrupts.
13.3.4.1 Output Inversion
The output state of the comparator may be inverted using the CPINV bit in register CMPnMD. When CPINV is 0, the output reflects the
non-inverted state: CPOUT will be 1 when CP+ > CP- and 0 when CP+ < CP-. When CPINV is set to 1, the output reflects the inverted
state: CPOUT will be 0 when CP+ > CP- and 1 when CP+ < CP-. Output inversion is applied directly at the comparator module output
and affects the signal anywhere else it is used in the system.
EFM8UB3 Reference Manual
Comparators (CMP0 and CMP1)
silabs.com
| Building a more connected world.
Rev. 0.2 | 153