English
Language : 

HD64F38602R Datasheet, PDF (400/552 Pages) Renesas Technology Corp – Renesas 16-Bit Single-Chip Microcomputer
Section 18 Comparators
Set I bit in CCR to 1
Disable interrupts by the I bit.
Set CME bit to 1
Set CMIE bit to 1
Read CDR bit
Clear CMF bit
Set the comparator enable bit to 1.
Wait for the comparator stabilized.
Enable the interrupt. Actually, the
interrupt is masked by the I bit.
The CDR bit is latched in the internal
latch by reading it.
Clear the interrupt request flag.
Clear I bit in CCR to 0
Enable interrupts by the I bit.
Figure 18.4 Procedure for Setting Interrupt (2)
18.5 Usage Notes
1. The COMP pin whose channel is operating as a comparator becomes a comparator analog
input pin. It cannot be used for any other function.
2. When external input is used as the reference voltage (CMR0 = 1 or CMR1 = 1), the VCref pin
cannot be used for any other function.
3. To stop the operation of a comparator, clear the CME0 and CME1 bits in CMCR0 and
CMCR1 to 0, before clearing the COMPCKSTP bit in CKSTPR2 to 0.
4. If the LSI enters the standby mode or watch mode when a comparator is operating, the internal
operation of the comparator is maintained. Since the comparator operates even in standby
mode or watch mode, it returns to the same mode after the specified interrupt is canceled,
though the current for the comparator is consumed.
If a comparator is not required to return to the standby mode or watch mode when an interrupt
is canceled and the current consumption needs to be reduced, stop the comparator by clearing
the CME0 and CME1 bits in CMCR0 and CMCR1 to 0 before shifting the mode.
Rev. 3.00 May 15, 2007 Page 368 of 516
REJ09B0152-0300