Comparator operation, Interrupts, Comparator definitions – Zilog Z86193 User Manual
Page 79

Z8
®
CPU
User Manual
UM001604-0108
Input/Output Ports
72
Comparator Operation
After enabling the Analog Comparator mode, P33 becomes a common reference input for
both comparators. The P33 (Ref) is hard wired to the reference inputs to both comparators
and cannot be separated. P31 and P32 are always connected to the positive inputs to the
comparators. P31 is the positive input to comparator AN1 while P32 is the positive input
to comparator AN2. The outputs to comparators AN1 and AN2 are AN1-out and AN2-out,
respectively.
The comparator output reflects the relationship between the positive input and the refer-
ence input.
Example
If the voltage on AN1 is higher than the voltage on Ref then AN1-out is at a high state. If
voltage on AN2 is lower than the voltage on Ref then AN2-out is at a Low state. In this
example, when the Port 3 register is read, Bits D1 = 1 and D2 = 0. If the comparator out-
puts are enabled to come out on P34 and P37, then P34 = 1 and P37 = 0.
The previous data stored in P34 and P37 is not disturbed. Once the comparator outputs are
de-selected the stored values in the P34 and P37 register bits are reflected on these pins
again.
Interrupts
P32 (AN2) will generate an interrupt based on the result of the comparison being low and
the Interrupt Request Register (
IRQ
FAh
) having bits D7 = 0 and D6 = 0. If IRQ D7 = 1
and D6 = 0 then both P31 and P32 would generate interrupts.
Comparator Definitions
V
ICR
The usable voltage range for both positive inputs and the reference input is called the com-
mon mode voltage range (V
ICR
). The comparator is not guaranteed to work if the inputs
are outside of the V
ICR
range.
V
OFFSET
The absolute value of the voltage between the positive input and the reference input
required to make the comparator output voltage switch is the input offset voltage (V
OFF
-
SET
). If AN1 is 3.000 V and Ref is 3.001 V when the comparator output switches states
then the V
offset
= 1 mV.
LD R0, #XXXX XXX1b
;Enables comparator
;outputs using PCON
;Register programming
Note:
- Z86233 Z86243 Z86733 Z86743 Z86C02 Z86C04 Z86C08 Z86C15 Z86C21 Z86C30 Z86C31 Z86C33 Z86C36 Z86C40 Z86C43 Z86C61 Z86C62 Z86C63 Z86C65 Z86C83 Z86C90 Z86C91 Z86C93 Z86C96 Z86E02 Z86E03 Z86E04 Z86E06 Z86E07 Z86E08 Z86E15 Z86E21 Z86E30 Z86E31 Z86E33 Z86E34 Z86E40 Z86E43 Z86E44 Z86E61 Z86E63 Z86E83 Z86K15 Z86L02 Z86L04 Z86L08 Z86L16 Z8E000 Z8E001 Z8PE003