Renesas RA Family
RA2 Quick Design Guide
R01AN6060EU0100 Rev.1.00
Page 28 of 44
Sep.14.21
•
Since most pins have multiple functions, the RA2 MCUs have Pin Function Control Registers (PmnPFS)
that allow you to change the function assigned to a pin.
•
Each pin has its own PmnPFS register.
•
Each PmnPFS register allows a pin to be used for peripheral function (PSEL bits), as an IRQ input pin
(ISEL bit), or as an analog input pin (ASEL bit). If the ASEL bit is set to “1” (use pin as analog input pin)
then the pin’s PMR bit should be set for GPIO use and the pin’s PDR bit should be set for input.
•
Refer to the “Peripheral Select Settings for each Product” section in the “I/O Ports” chapter of the
Hardware User’s Manual.
•
In order to ensure that no unexpected edges are input or output on peripheral pins, make sure to clear
the Port Mode Control (PMR) bit for the targeted pin before modifying the pin’s PmnPFS register.
•
All PmnPFS registers are write protected out of reset. In order to write to these registers, first enable
writing using the Write-Protect Register (PWPR).
•
Care should be taken when setting PmnPFS registers so that a single function is not assigned to multiple
pins. The user should not do this but the MCU will allow it. If this occurs the function on the pins will be
undefined.
•
Figure 20 shows an example of enabling SPI0 pins using FSP Pin configuration.
Figure 20. Enabling SPI0 pins using Pin Configurator in Renesas FSP
9.4 Setting Up and Using IRQ Pins
•
Certain port pins can be used as hardware interrupt lines (IRQ). See the “Peripheral Select Settings for
each Product” section in the “I/O Ports” chapter of the Hardware User’s Manual for information on which
pins are available for your MCU.
•
To set a port pin to be used as an IRQ pin, the Interrupt Input Function Select bit (ISEL) in the pin’s PFS
register must be set to “1”.
•
Pins can be used for both IRQ and peripheral functions simultaneously. To enable this, set both the ISEL
and PSEL bits in the pin’s PFS register.
•
IRQ functions of the same number must only be enabled on one pin.
•
IRQ pins can trigger interrupts on detection of:
Low level
Falling edge
Rising edge
Rising and falling edges
The IRQ Control Registers (IRQCRi) controls which trigger is selected.
•
Digital filtering is available for IRQ pins. The filters are based on repetitive sampling of the signal at one of
four selectable clock rates (PCLKB, PCLKB/8, PCLKB/32, PCLKB/64). This filters out short pulses: any
high or low pulse less than 3 samples at the filter rate. The filters are useful for filtering out ringing and