Product Specs

Table Of Contents
39 LPCOMP Low power comparator
Page
404
hysteresis is enabled, the upward crossing level becomes (VIN- + VHYST/2), and the downward crossing
level becomes (VIN- - VHYST/2).
The LPCOMP is stopped by triggering the STOP task.
VIN+
VIN- + VHYST/2
VIN- - VHYST/2
t
Output
Figure 116: Effect of hysteresis on a noisy input signal
LPCOMP will be operational in both System ON and System OFF mode when it is enabled through the
ENABLE register. See POWER Power supply on page 78 for more information about power modes. Note
that it is not allowed to go to System OFF when a READY event is pending to be generated.
All LPCOMP registers, including ENABLE, are classified as retained registers when the LPCOMP is enabled.
However, when the device wakes up from System OFF, all LPCOMP registers will be reset.
The LPCOMP can wake up the system from System OFF by asserting the ANADETECT signal. The
ANADETECT signal can be derived from any of the event sources that generate the UP, DOWN and
CROSS events. In case of wakeup from System OFF, no events will be generated, only the ANADETECT
signal. See the ANADETECT register ( ANADETECT on page 408) for more information on how to
configure the ANADETECT signal.
The immediate value of the LPCOMP can be sampled to RESULT on page 407 by triggering the
SAMPLE task.
See RESETREAS on page 85 for more information on how to detect a wakeup from LPCOMP.
39.1 Shared resources
The LPCOMP shares resources with other peripherals.
The LPCOMP shares analog resources with SAADC and COMP. While it is possible to use SAADC at
the same time as COMP or LPCOMP, COMP and LPCOMP are mutually exclusive: enabling one will
automatically disable the other. In addition, when using SAADC and COMP or LPCOMP simultaneously, it is
not possible to select the same analog input pin for both modules.
The LPCOMP peripheral shall not be disabled (by writing to the ENABLE register) before the peripheral has
been stopped. Failing to do so may result in unpredictable behaviour.
39.2 Pin configuration
You can use the LPCOMP.PSEL register to select one of the analog input pins, AIN0 through AIN7, as the
analog input pin for the LPCOMP.
See GPIO General purpose input/output on page 111 for more information about the pins. Similarly, you
can use EXTREFSEL on page 408 to select one of the analog reference input pins, AIN0 and AIN1, as
input for AREF in case AREF is selected in EXTREFSEL on page 408. The selected analog pins will be
acquired by the LPCOMP when it is enabled through ENABLE on page 407.
ABOVE BELOW
(VIN+ > (VIN- + VHYST/2)) (VIN+ < (VIN- - VHYST/2))
ABOVE
(VIN+ > (VIN- + VHYST/2))
BELOW