ML610Q111/ML610Q112 User’s Manual
Chapter 22 Analog Comparator
FEUL610Q111
22-9
22.3 Description of Operation
22.3.1
Comparator Functions
The comparator compares the input voltages of the CMPnP and CMPnM pins to output the result to the CMPnD bit of the
comparator control register 0 (CMPnCON0).
CMPnEN of CMPnCON0 is controlled by the comparator enable. When CMPnEN is set to “1”, the comparator is activated
(ON). When CMPnEN is set to “0”, the comparator is deactivated (OFF) and has no supply current.
The comparison result is read from the CMPnD bit. When CMPnD is “1”, it indicates that the input voltage of the CMPnP
pin is higher than that of the CMPnM pin. When CMPnD is “0”, it indicates that the input voltage of the CMPnP pin is
lower than that of the CMPnM pin.
The comparator requires a settling time. Read CMPnD bit 100us or more after CMPnEN bit is set to “1”.
Figure 22-2 shows an example of the operation timing diagram.
Figure 22-2 Example of Operation Timing Diagram (n=0,1)
The operations in Figure 22-2 are described below.
Select the interrupt mode by CMPnCON1.
Set CMPnEN to “1” to turn on the comparator.
Wait the settling time (min. 100 us) of the comparator.
Read the comparison result (CMPnD).
Set CMPnEN to “0” to turn off the comparator. At the same time, the result is retained.
CMPnD can be read after CMPnEN is set to
“
0
”
because CMPnD holds the comparison result at the time when
CMPnEN is set to
“
0
”
.
Note
:
When PA1, PB4 or PB5 is used as an input pin of comparator, set an applicable port as a high impedance output state.
For how to set, see Chapter 15 “Port A” and Chapter 16 “Port B”.
Set CMPnEN
↓
Wait for settling time
of comparator
(100us or more)
CMPnEN
CMPnP
CMPnD
CMPnDReading
CMPnENReset
↓
Operation
↓
CMPnM
Comparison
result retained
n=0,1
Summary of Contents for ML610Q111
Page 1: ...ML610Q111 ML610Q112 User s Manual Issue Date Nov 16 2016 FEUL610Q111 05 ...
Page 14: ...Chapter 1 Overview ...
Page 26: ...Chapter 2 CPU and Memory Space ...
Page 34: ...Chapter 3 Reset Function ...
Page 38: ...Chapter 4 MCU Control Function ...
Page 53: ...Chapter 5 Interrupts INTs ...
Page 81: ...Chapter 6 Clock Generation Circuit ...
Page 95: ...Chapter 7 Time Base Counter ...
Page 103: ...Chapter 8 Timers ...
Page 145: ...Chapter 9 Watchdog Timer ...
Page 153: ...Chapter 10 PWM ...
Page 199: ...Chapter 11 Synchronous Serial Port ...
Page 212: ...Chapter 12 UART ...
Page 240: ...Chapter 13 I2 C Bus Interface Master ...
Page 254: ...Chapter 14 I2 C Bus Interface Slave ...
Page 269: ...Chapter 15 Port A ...
Page 279: ...Chapter 16 Port B ...
Page 291: ...Chapter 17 Port C ...
Page 303: ...Chapter 18 Port D ...
Page 312: ...Chapter 19 Port AB Interrupts ...
Page 317: ...Chapter 20 Successive Approximation Type A D Converter ...
Page 335: ...Chapter 21 Voltage Level Supervisor ...
Page 342: ...Chapter 22 Analog Comparator ...
Page 353: ...Chapter 23 Data Flash Memory ...
Page 373: ...Chapter 24 On chip Debug ...
Page 375: ...Appendixes ...
Page 393: ...Appendix E ...
Page 398: ...Revision History ...