English
Language : 

HD64F38602R Datasheet, PDF (399/552 Pages) Renesas Technology Corp – Renesas 16-Bit Single-Chip Microcomputer
Section 18 Comparators
To set the interrupt, follow the procedure shown in figure 18.3 or 18.4.
[1] Set the CME bit. Wait a conversion time for the comparator stabilized.
[2] Read the CDR bit.
[3] Set the CMIE bit.
[4] Read the CDR bit. At this time, the CDR bit is latched in the internal latch for the comparator
and the internal interrupt enable signal is asserted.
[5] As the relationship between the voltage on the COMP pin and reference voltage is changed,
a difference occurs between the output level of the internal latch and the CDR bit. Then an
interrupt is generated.
[6] Clear the CMF bit in the interrupt handler. When reading the CMF bit for clearing it, the CDR bit is
also read since those bits are in the same register. Therefore, the output of the internal latch is
updated. Go to step [5] to continue use of the interrupt.
[7] Clear the CMIE bit to clear the interrupt setting and clear the CME bit to stop the comparator.
Clearing the CMIE bit negates the internal interrupt enable signal.
The interrupt flag may be set depending on the internal states of the comparator, pin states, the
timing of setting the internal interrupt enable signal shown in step [4], and the timing of the CDR bit
latched. To avoid this, execute steps [2] to [4] continuously or ensure that the CMF bit is cleared
using the I bit in CCR as shown in figure 18.4.
When CMR = 0 and CMRS3 to CMRS0 = B'1000 (VIH = 19/30 Vcc)
19/30 Vcc
Voltage on
COMP pin
CDR (CMLS = 0)
Conversion time
CME
[1]
CMIE
[3]
Interrupt enable signal
Stabilization time
(conversion time)
CDR read signal
Internal latch
for comparator
CMF
[2] [4]
[6]
Unstable
[4]
[6]
[5]
[6]
Conversion time
[7]
[7]
[6]
[6]
[5]
[6]
Figure 18.3 Procedure for Setting Interrupt (1)
Rev. 3.00 May 15, 2007 Page 367 of 518
REJ09B0152-0300