Z8 Encore! XP
®
4K Series
Product Specification
131
The comparator may be powered down to reduce supply current. See the
on
for details.
Caution:
Because of the propagation delay of the comparator, it is not recommended to enable or
reconfigure the comparator without first disabling interrupts and waiting for the com-
parator output to settle. Doing so can result in spurious interrupts. The following exam-
ple shows how to safely enable the comparator:
di
ld cmp0, r0 ; load some new configutation
nop
nop
; wait for output to settle
clr irq0 ; clear any spurious interrupts pending
ei
Comparator Control Register Definitions
Comparator Control Register
The Comparator Control Register (CMP0) configures the comparator inputs and sets the
value of the internal voltage reference.
Table 78. Comparator Control Register (CMP0)
BITS
FIELD
RESET
R/W
ADDR
0
R/W
0
R/W
0
R/W
1
R/W
F90H
0
R/W
1
R/W
7
INPSEL
6
INNSEL
5
4
REFLVL
3
2
1
0
Reserved (20-/28-pin)
REFLVL (8-pin)
0
R/W
0
R/W
INPSEL—Signal Select for Positive Input
0 = GPIO pin used as positive comparator input
1 = temperature sensor used as positive comparator input
INNSEL—Signal Select for Negative Input
0 = internal reference disabled, GPIO pin used as negative comparator input
1 = internal reference enabled as negative comparator input
REFLVL—Internal Reference Voltage Level (this reference is independent of the ADC
voltage reference). Note that the 8-pin devices contain two additional LSBs for increased
resolution.
For 20-/28-pin devices:
PS022815-0206
Comparator