Interrupts; Comparator Pin Output - Renesas RX100 Series User Manual

32-bit mcu
Hide thumbs Also See for RX100 Series:
Table of Contents

Advertisement

RX13T Group
28.3.3

Interrupts

Comparator C generates an interrupt request upon detecting any changes in the comparison result.
When using the CMPCn interrupt, set at least one of bits CMPCTL.CEG[1:0] to 1 (to a value other than 00b (interrupt
request is not generated)).
To use the CMPCn interrupt, use the following setting procedure. Note that steps (1), (2), and (3) can be set in any order.
(1) When using the on-chip D/A converter output voltage as the reference input voltage, set the D/A converter for
generating comparator C reference voltage and enable operation.
(2) Set the CMPSEL0 or CMPSEL1 register to set the input of the comparator.
(3) Set the CMPCTL.CINV and CDFS[1:0] bits to select inversion or non-inversion processing and the sampling
timing of the noise filter.
(4) Enable the edge for interrupt detection (set the CMPCTL.CEG[1:0] bits to a value other than 00b).
(5) Enable input of the comparator (set the CMPCTL.HCMPON bit to 1) and wait for the time until the comparator
operation is stabilized. As for the value, refer to section 32, Electrical Characteristics .
(6) Enable output of the comparator (set the CMPCTL.COE bit to 1).
28.3.4

Comparator Pin Output

The comparison results can be output to the COMPn pins (n = 0 to 2). The CMPCTL.CINV bit can be used to set the
output polarity (non-inverted output or inverted output), and the CMPIOC.CPOE bit can be used to enable or disable the
output.
To output the comparison result to the external pin COMPn, use the following setting procedure. Note that the ports are
set to input after reset.
(1) Execute steps (1) to (3) and steps (5) and (6) shown in section 28.3.3, Interrupts .
(2) Output the comparison result by the comparator to an external pin (set the CMPIOC.CPOE bit to 1).
(3) Set the port mode register and the pin function control register corresponding to each comparator output pin.
R01UH0822EJ0100 Rev.1.00
Jul 31, 2019
28. Comparator C (CMPC)
Page 897 of 1041

Advertisement

Table of Contents
loading

Table of Contents