SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 101
Version 2.0
1
1
1
1
1
1
ANALOG COMPARAOTR 2
11.1 OVERVIEW
The micro-controller builds in one comparator with shrinking TC0 pulse width function. The comparator has normal
comparator mode and shrinking TC0 pulse width 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 comparator builds in internal reference
voltage connected to comparator positive terminal, and comparator positive input pin can be GPIO mode as enabling
internal reference voltage source. The main purposes of comparator 2 are as following.
Normal comparator function:
General comparator mode compares the two tensions of positive input terminal
and negative input terminal.
Interrupt function:
Comparator 2 supports interrupt function. When comparator 2 output edge direction equals to
edge selection, the CM2IRQ actives and the system points program counter to interrupt vector to do interrupt
sequence.
TC0 pulse width shrinking source:
Comparator 2 can be TC0 pulse width shrinking trigger source controlled by
CM2SF bit. When TC0PO = 1 and CM2SF = 1, comparator 2 output status triggers to shrink TC0 pulse width
through increasing TC0R register.
Green mode function:
Comparator 2 still actives in green mode, but no wake-up function. CM2IRQ can be
latched as trigger event occurrence until system wakes up. After system wakes up, the comparator 2 interrupt
service routine is executed by program.
CM2EN
GPIO/CM2P Pin
GPIO
CM2EN
GPIO/CM2N Pin
GPIO/CM2O Pin
GPIO
CM2EN
GPIO
CM2OEN
CM2G
CM2OUT flag
CM2IRQ
Comparator Output Delay:
0, 2/Fcpu, 4/Fcpu, 6/Fcpu,
8/Fcpu, 10/Fcpu, 12/Fcpu,
14/Fcpu, 16/Fcpu, 18/Fcpu,
20/Fcpu, 22/Fcpu, 24/Fcpu,
26/Fcpu, 28/Fcpu, 30/Fcpu
CM2D[3:0]
CM2SF
Increase TC0R to
shrink TC0 Pulse
width
+
_
Vdd
Vss
CM2RS[2:0]
0.2*Vdd
0.3*Vdd
0.4*Vdd
0.5*Vdd
0.6*Vdd
0.7*Vdd
0.8*Vdd
Interface
reference
voltage source