
I-136
EPSON
S1C88348/317/316/308 TECHNICAL HARDWARE
5 PERIPHERAL CIRCUITS AND THEIR OPERATION (Analog Comparator)
5.14.2 Mask option
Since the input terminals of the analog comparator
are common to the I/O ports, the mask option for
the I/O port corresponding to the channel to be
used must be set to "Gate direct".
I/O ports pull-up resistor
P14 (CMPP0) ... s
s With resistor Gate direct
P15 (CMPM0) .. s
s With resistor Gate direct
P16 (CMPP1) ... s
s With resistor Gate direct
P17 (CMPM1) .. s
s With resistor Gate direct
*
"" above shows an example of both channels
being used.
5.14.3 Analog comparator operation
By writing "1" to the analog comparator control
register CMPxON, the analog comparator goes ON,
and the analog comparator starts comparing the
external voltages that have been input to the two
differential input terminals CMPPx and CMPMx.
The result can be read from the comparator com-
parison result detection bit CMPxDT through the
latch and when CMPPx (+) > CMPMx (-), it is "1"
and when CMPPx (+) < CMPMx (-), it is "0". After
the analog comparator has been turned ON, a
maximum time of 3 msec is necessary until output
stabilizes. Consequently, you should allow an
adequate waiting time after turning the analog
comparator ON, before reading the comparison
result.
When the analog comparator is turned OFF, the
comparison result at that point will be latched and
the concerned data can be read thereafter, until the
analog comparator is turned ON.
You should turn the analog comparator OFF, when
it is not necessary, so as to reduce current consump-
tion.
See "7 ELECTRICAL CHARACTERISTICS" for the
input voltage range.
Note: Since the input terminals of the analog
comparator are common to the I/O ports, the
I/O control registers (IOC14–IOC17) corre-
sponding to the channel to be used must be
set to the input mode.
5.14 Analog Comparator
5.14.1 Configuration of analog comparator
The S1C883xx has an MOS input analog compara-
tor built into two channels. The respective analog
comparators have two differential input terminals
(inverted input terminal CMPMx and non-inverted
input terminal CMPPx) that are available for
general purpose use.
Figure 5.14.1.1 shows the configuration of the
analog comparator.
Fig. 5.14.1.1 Configuration of analog comparator
Since the input terminals of the analog comparator
CMPP0, CMPM0, CMPP1 and CMPM1 are com-
mon to I/O ports P14–P17, when using as the input
terminal for the analog comparator, "0" (input
mode) must be written to I/O control registers
IOC14–IOC17.
Table 5.14.1.1 Input terminal configuration
Data
bus
CMP0DT
VDD
VSS
CMPP0 (P14)
CMPM0 (P15)
+
–
CMP0ON
CMP1DT
VDD
VSS
CMPP1 (P16)
CMPM1 (P17)
+
–
CMP1ON
Latch
<Channel 0>
<Channel 1>
Terminal
P14
P15
P16
P17
When analog comparator is used
CMPP0
CMPM0
CMPP1
CMPM1