
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)
Содержание ML62Q1000 Series
Страница 17: ...Chapter 1 Overview...
Страница 112: ...Chapter 2 CPU and Memory Space...
Страница 154: ...Chapter 3 Reset Function...
Страница 166: ...Chapter 4 Power Management...
Страница 196: ...Chapter 5 Interrupts...
Страница 248: ...Chapter 6 Clock generation Circuit...
Страница 274: ...Chapter 7 Low Speed Time Base Counter...
Страница 291: ...Chapter 8 16 Bit Timer...
Страница 320: ...Chapter 9 Functional Timer FTM...
Страница 382: ...Chapter 10 Watchdog Timer...
Страница 402: ...Chapter 11 Serial Communication Unit...
Страница 456: ...Chapter 12 I2 C Bus Unit...
Страница 491: ...Chapter 13 I2 C Master...
Страница 512: ...Chapter 14 DMA Controller...
Страница 531: ...Chapter 15 Buzzer...
Страница 550: ...Chapter 16 Simplified RTC...
Страница 559: ...Chapter 17 GPIO...
Страница 594: ...Chapter 18 External Interrupt Function...
Страница 612: ...Chapter 19 CRC Generator...
Страница 632: ...Chapter 20 Analog Comparator...
Страница 644: ...Chapter 21 D A Converter...
Страница 655: ...Chapter 22 Voltage Level Supervisor...
Страница 676: ...Chapter 23 Successive Approximation Type A D Converter...
Страница 709: ...Chapter 24 Regulator...
Страница 714: ...Chapter 25 Flash Memory...
Страница 743: ...Chapter 26 Code Option...
Страница 750: ...Chapter 27 LCD Driver...
Страница 788: ...Chapter 28 On Chip Debug Function...
Страница 795: ...Chapter 29 Safety Function...
Страница 813: ...Appendix A...
Страница 881: ...Revision History...