SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
9
ANALOG COMPARAOTR 0
9.1 OVERVIEW
The micro-controller builds in one comparator with TC0 pulse generator trigger function. The comparator has normal
comparator mode and TC0 pulse output trigger source. The comparator is not Rail-to-Rail structure. That means the
input voltage is not real from Vdd~Vss (Reference to “Electrical characteristics” chapter). When the positive input
voltage is greater than the negative input voltage, the comparator output is high. When the positive input voltage is
smaller than the negative input voltage, the comparator output is low. The main purposes of comparator 0 are as
following.
Normal comparator function: General comparator mode compares the two tensions of positive input terminal
and negative input terminal.
Interrupt function: Comparator 0 supports interrupt function. When comparator 0 output edge direction equals to
edge selection, the CM0IRQ actives and the system points program counter to interrupt vector to do interrupt
sequence.
TC0 pulse generator trigger source: Comparator 0 can be TC0 pulse generator trigger source controlled by
CM0SF bit. When TC0PO = 1 and CM0SF = 1, comparator 0 output status triggers TC0 pulse generator to
outputs pulse signal.
Green mode function: Comparator 0 still actives in green mode, but no wake-up function. CM0IRQ can be
latched as trigger event occurrence until system wakes up. After system wakes up, the comparator 0 interrupt
service routine is executed by program.
CM0EN
GPIO
GPIO/CM0P Pin
CM0D[3:0]
CM0EN
CM0EN
CM0G
Vdd
Vss
Comparator Output Delay:
0, 1/Fhosc, 2/Fhosc, 3/Fhosc,
4/Fhosc, 5/Fhosc, 6/Fhosc,
7/Fhosc, 8/Fhosc, 9/Fhosc,
10/Fhosc, 11/Fhosc, 12/Fhosc,
13/Fhosc, 14/Fhosc, 15/Fhosc
+
_
GPIO
GPIO
CM0IRQ
GPIO/CM0N Pin
CM0SF
TC0 Pulse Generator
CM0OUT flag
GPIO/CM0O Pin
CM0OEN
SONiX TECHNOLOGY CO., LTD
Page 89
Version 2.0