Advance Information
UM-TM57PE10_E
8-Bit Microcontroller
25
tenx technology inc.
Preliminary
Rev 1.4, 2012/01/19
3.6 Analog Comparator
TM57PE10 includes an analog comparator. It can be enabled by CMPEN which is in R-Plane 17H Bit7.
The analog comparator compares the input values on the positive pin Vin+ and negative pin Vin-. When
the voltage on positive pin is higher than the voltage on the negative pin, the analog comparator out
(CMPO) is set. The output status CMPST can be read from F-Plane 14H Bit3, or output to pin by setting
CMPOE which in R-plane 17H Bit5. The analog comparator can generate interrupt (CMPI) when the
output status changes. The user can select interrupt triggering on comparator output rise or fall. The
input source of negative pin can be selected from IN0- or IN0+ by CMPINNS. The analog comparator
supports internal reference voltage. The internal reference voltage provides the range of output voltage
with 15 distinct levels. The range can be selected by CMPINPS. A block diagram of the analog
comparator is shown below.
PD
CMPST
(read only)
Output
CMP
Interrupt
edge
1101
0001
0000
Input
VDD x 14/16
PD
CMPINPS[3:0]
2R
R
R
R
CMPOE
CMPI
1110
1111
R
VDD x 13/16
VDD x 1/16
VDD
VSS
IN0-
IN+
Input
CMPO
CMPINNS
IN1-
Input
0
1
CMPEDGE
Vin-
Vin+