English
Language : 

Z8F0830HH020SG Datasheet, PDF (124/257 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore!® F0830 Series
Product Specification
106
Comparator
The Z8 Encore! F0830 Series devices feature a general purpose comparator that compares
two analog input signals. A GPIO (CINP) pin provides the positive comparator input. The
negative input (CINN) can be taken from either an external GPIO pin or from an internal
reference. The output is available as an interrupt source or can be routed to an external pin
using the GPIO multiplex. The comparator includes the following features:
• Positive input is connected to a GPIO pin
• Negative input can be connected to either a GPIO pin or a programmable internal ref-
erence
• Output can be either an interrupt source or an output to an external pin
Operation
One of the comparator inputs can be connected to an internal reference that is a user-
selectable reference and is user-programmable with 200 mV resolution.
The comparator can be powered down to save supply current. For details, see the Power
Control Register 0 section on page 31.
Caution: As a result of the propagation delay of the comparator, Zilog does not recommend en-
abling the comparator without first disabling interrupts and waiting for the comparator
output to settle. This delay prevents spurious interrupts after comparator enabling.
The following example shows 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
PS025113-1212
Comparator