RL78/G15 CHAPTER 11 COMPARATOR
R01UH0959EJ0110 Rev.1.10 Page 356 of 765
Mar 7, 2023
11.3.5 Registers Controlling Port Functions of Comparator I/O Pins
The port mode register 0 (PM0), port mode register 2 (PM2), port register 0 (P0), port register 2 (P2), port mode control
register 0 (PMC0), and port mode control register 2 (PMC2) should be appropriately set to control the functions of the
port pins that are also used for input and output of the comparator. For details, see 4.3.1 Port mode registers 0, 2, 4,
12 (PM0, PM2, PM4, PM12), 4.3.2 Port registers 0, 2, 4, 12, 13 (P0, P2, P4, P12, P13), and 4.3.5 Port mode control
registers 0, 2 (PMC0, PMC2). For an example of settings when using a port pin for input and output of the comparator,
see 4.5.3 Register setting examples for used port and alternate functions.
When using the IVCMP0 and IVREF0 pins as analog inputs of the comparator, set the corresponding bits in the port
mode register (PM0) and port mode control register (PMC0) to 1.
When using the VCOUT0 pin as a comparator output, set the bits in the port mode register (PM0), port register (P0), and
port mode control register (PMC0) to 0. For details on the VCOUT0 pin output setting, follow the setting procedure in
11.4.3 Comparator n Output (n = 0, 1).
When using the IVCMP1 and IVREF1 pins as analog inputs of the comparator, set the corresponding bits in the port
mode register (PM2) and port mode control register (PMC2) to 1.
When using the VCOUT1 pin as a comparator output, set the bits in the port mode register (PM4), port register (P4), and
port mode control register (PMC4) to 0. For details on the VCOUT1 pin output setting, follow the setting procedure in
11.4.3 Comparator n Output (n = 0, 1).