English
Language : 

Z8F0113HJ005EG Datasheet, PDF (147/245 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F0823 Series
Product Specification
132
Comparator
Z8 Encore! XP F0823 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 an internal refer-
ence. The output is available as an interrupt source or can be routed to an external pin
using the GPIO multiplex.
The features of the comparator include:
• Two inputs which can be connected up using the GPIO multiplex (MUX)
• One input can be connected to a programmable internal reference
• One input can be connected to the on-chip temperature sensor
• 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 which is a user
selectable reference that is user programmable with 200 mV resolution.
The comparator can be powered down to save on supply current. For details, see the Power
Control Register 0 section on page 31.
Caution: Because of the propagation delay of the comparator, Zilog does not recommend enabling
or reconfiguring the comparator without first disabling the interrupts and waiting for the
comparator output to settle. Doing so can result in spurious interrupts.
The following example shows how to safely enable the comparator:
di
ld cmp0
nop
nop
; wait for output to settle
clr irq0 ; clear any spurious interrupts pending
ei
PS024315-1011
PRELIMINARY
Comparator