SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
10ANALOG COMPARAOTR 1
10.1 OVERVIEW
The micro-controller builds in one comparator with stopping TC0 pulse generator function. The comparator has normal
comparator mode and stopping 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 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 1 are as following.
Normal comparator function: General comparator mode compares the two tensions of positive input terminal
and negative input terminal.
Interrupt function: Comparator 1 supports interrupt function. When comparator 1 output edge direction equals to
edge selection, the CM1IRQ actives and the system points program counter to interrupt vector to do interrupt
sequence.
TC0 pulse generator trigger stopping source: Comparator 1 can be TC0 pulse generator stopping trigger
source controlled by CM1SF bit. When TC0PO = 1 and CM1SF = 1, comparator 1 output status triggers TC0
pulse generator to stop outputting pulse signal.
Green mode function: Comparator 1 still actives in green mode, but no wake-up function. CM1IRQ can be
latched as trigger event occurrence until system wakes up. After system wakes up, the comparator 1 interrupt
service routine is executed by program.
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
CM1EN
CM1EN
CM1EN
CM1RS[2:0]
GPIO
GPIO
GPIO
GPIO/CM1P Pin
CM1D[3:0]
CM1G
Vdd
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
+
_
CM1IRQ
GPIO/CM1N Pin
GPIO/CM1O Pin
CM1SF
Vss
Stop TC0 Pulse Generator
CM1OUT flag
CM1OEN
SONiX TECHNOLOGY CO., LTD
Page 95
Version 2.0