English
Language : 

Z8F082ASJ020EG Datasheet, PDF (158/282 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F082A Series
Product Specification
141
The following code example illustrates how to safely enable the comparator:
di
ld cmp0, r0 ; load some new configuration
nop
nop
; wait for output to settle
clr irq0 ; clear any spurious interrupts pending
ei
Comparator Control Register Definition
The Comparator Control Register (CMP0) configures the comparator inputs and sets the
value of the internal voltage reference.
Table 77. Comparator Control Register (CMP0)
Bit
7
6
5
Field
INPSEL INNSEL
RESET
0
0
0
R/W
R/W
R/W
R/W
Address
4
3
REFLVL
1
0
R/W
R/W
F90H
2
1
0
Reserved (20-/28-pin)
REFLVL (8-pin)
1
0
0
R/W
R/W
R/W
Bit
[7]
INPSEL
[6]
INNSEL
Description
Signal Select for Positive Input
0 = GPIO pin used as positive comparator input.
1 = Temperature sensor used as positive comparator input.
Signal Select for Negative Input
0 = Internal reference disabled, GPIO pin used as negative comparator input.
1 = Internal reference enabled as negative comparator input.
PS022827-1212
P R E L I M I N A R Y Comparator Control Register Definition