
ML62Q1000 Series User's Manual
Chapter 20 Analog Comparator
FEUL62Q1000
20-9
20.3 Description of Operation
20.3.1 Analog Comparator Operation
Figure 20-2 shows an analog comparator operation overview.
Figure 20-2
Analog
Comparator Operation Overview
Figure 20-3 shows an example of the analog comparator operation timing.
Figure 20-3 Example of
Analog
Comparator Operation Timing
Operation shown in Figure 20-3 above is described below.
(1)
To operate the analog comparator, first set the following configuration:
−
Set the general-purpose port used for the analog comparator to high-impedance, by writing "0" to PnmIE
bit and PnmOE bit (m: bit number 0 to 7).
−
If using the high-speed clock for the sampling clock, write "1" to the ENOSC bit of the frequency control
register (FCON).
−
If using interrupt, write "1" to the ECMPn bit of the interrupt enable register 45 (IE45).
−
Enable clock supply using the block clock control register 3 (BCKCON3).
−
Release the analog comparator reset using the block reset control register 3 (BRECON3).
(2)
Choose the interrupt mode and sampling conditions using the CMPnMOD register.
(3)
Write "1" to the CMPnEN bit to enable the analog comparator operation.
(4)
Wait for the stabilization time (100 μs or more) of the analog comparator.
(5)
Read the comparison result from the CMPnD bit.
After a lapse of the analog comparator stabilization time (100
μs or
more),
read the CMPnD bit.
CMPnD="0": CMPnP pin input voltage is lower
CMPnD="1": CMPnP pin input voltage is higher
Start
End
Confirm comparison result
CMPnEN="1"
Start comparison between the CMPnP pin input voltage and CMPnM
pin input voltage, or between CMPnP pin input voltage and 0.8 V
reference voltage
Enable analog
comparator operation
Store comparison result
The comparison result is stored in the CMPnD bit.
(3)
CMPnEN set
↓
(5)
Comparator
stabilization time secured
(100 µs or more)
CMPnEN
CMPnP
CMPnD
CMPnD read
CMPnEN reset
↓
(6)
(4)
Operation
↓
CMPnM
Comparison result retained
(7)
(1)
(2)
Summary of Contents for ML62Q1000 Series
Page 17: ...Chapter 1 Overview...
Page 112: ...Chapter 2 CPU and Memory Space...
Page 154: ...Chapter 3 Reset Function...
Page 166: ...Chapter 4 Power Management...
Page 196: ...Chapter 5 Interrupts...
Page 248: ...Chapter 6 Clock generation Circuit...
Page 274: ...Chapter 7 Low Speed Time Base Counter...
Page 291: ...Chapter 8 16 Bit Timer...
Page 320: ...Chapter 9 Functional Timer FTM...
Page 382: ...Chapter 10 Watchdog Timer...
Page 402: ...Chapter 11 Serial Communication Unit...
Page 456: ...Chapter 12 I2 C Bus Unit...
Page 491: ...Chapter 13 I2 C Master...
Page 512: ...Chapter 14 DMA Controller...
Page 531: ...Chapter 15 Buzzer...
Page 550: ...Chapter 16 Simplified RTC...
Page 559: ...Chapter 17 GPIO...
Page 594: ...Chapter 18 External Interrupt Function...
Page 612: ...Chapter 19 CRC Generator...
Page 632: ...Chapter 20 Analog Comparator...
Page 644: ...Chapter 21 D A Converter...
Page 655: ...Chapter 22 Voltage Level Supervisor...
Page 676: ...Chapter 23 Successive Approximation Type A D Converter...
Page 709: ...Chapter 24 Regulator...
Page 714: ...Chapter 25 Flash Memory...
Page 743: ...Chapter 26 Code Option...
Page 750: ...Chapter 27 LCD Driver...
Page 788: ...Chapter 28 On Chip Debug Function...
Page 795: ...Chapter 29 Safety Function...
Page 813: ...Appendix A...
Page 881: ...Revision History...