IP2022 Users ManualPeripherals
www.ubicom.com
301
4.8
Comparator
The IP2022 has an on-chip analog comparator which uses
alternate functions of the RG0, RG1, and RG2 port pins. The RG1
and RG2 pins are the comparator negative and positive inputs,
respectively, while the RG0 pin is the comparator output pin. To
use the comparator, software must program the port direction
register (RGDIR) so that RG1 and RG2 are inputs. RG0 may be
set up as a comparator output pin.
Figure 4-14 Analog Comparator Block Diagram
The comparator enable bits are cleared on reset, which disables
the comparator. To avoid drawing additional current during power-
down mode, the comparator should be disabled before entering
power-down mode. A 50 mV hysteresis is applied between the
inputs, when the CMPHYS bit is set in the CMPCFG register.
515-017.eps
+
-
CMPEN,
CMPHYS CMPRES CMPOE
RG2
RG0
RG1