English
Language : 

HD404654 Datasheet, PDF (86/111 Pages) Hitachi Semiconductor – 4-Bit Single-Chip Microcomputer
HD404654 Series
Comparator
The block diagram of the comparator is shown in figure 71. The comparator compares input voltage with
the reference voltage.
Setting 1 to bit 3 (CER3) of the compare enable register (CER: $018) executes a voltage comparison. If an
input voltage at COMP0 or COMP1 is higher than the reference voltage, the TM or TMD command sets the
status flag (ST) high for the corresponding bits of the compare data register (CDR: $017) to COMP0 or
COMP1. On the other hand, if an input voltage at COMP0 or COMP1 is lower than the reference voltage,
the TM or TMD command clears the ST to 0.
COMP0
COMP1
VCref
+
Com-
parator
–
Comparator data
register (CDR)
2
Comparator enable
register (CER)
Figure 71 Block Diagram of Comparator
Compare Enable Register (CER: $018): Three-bit write-only register which enables comparator
operation, and selects the reference voltage and the analog input pin.
Compare Data Register (CDR: $017): Two-bit read-only register which latches the result of the
comparison between the analog input pins and the reference voltage. Bits 0 and 1 reflect the results of
comparison with COMP0 and COMP1, respectively. This register can be read only by the TM or TMD
command. Only bit CER3 corresponds to the analog input pin, which is selected by bits CER0 and CER1.
After a compare operation, the data in this register is not retained.
Note on Use: During compare operation, pins RD0/COMP0 and RD1/COMP1 operate as analog inputs and
cannot operate as R ports.
The comparator can operate in active mode but is disabled in other modes.
RE0/VCref cannot operate as an R port when the external input voltage is selected as the reference.
84