Using Encoder library, what interrupt pins on Uno R4 Minima?

Hi,

I am trying to use the Encoder library (version 1.4.2) on my new Arduino R4 Minima board. The library needs to know the interrupt pins on this MCU, these are not in interrupt_pins.h.

Getting this error message on compilation:
In file included from /Users/koen/Documents/Arduino/libraries/Encoder/Encoder.h:46:0,
from /Users/koen/Documents/Arduino/FM Radio 6.1/FM_Radio_6.1/FM_Radio_6.1.ino:202:
/Users/koen/Documents/Arduino/libraries/Encoder/utility/interrupt_pins.h:202:2: error: #error "Interrupts are unknown for this board, please add to this code"
#error "Interrupts are unknown for this board, please add to this code"
^~~~~

The datasheet for the R7FA4M1AB3CFM (https://www.renesas.com/us/en/document/dst/renesas-ra4m1-group-datasheet) mentions many interrupt pins, many more than the about 14 mentioned somewhere else.

Did anyone already figure out how to map the interrupt pins on the Arduino R4 Minima?

Koen

1 Like

Hi @kvd0
This may help:

If you are using the encoder library right now you can;t since its not configured for the R4 boards. I am stuck on these constructs:

#define IO_REG_TYPE                     uint16_t
#define PIN_TO_BASEREG(pin)             portModeRegister(digitalPinToPort(pin))
#define PIN_TO_BITMASK(pin)             (digitalPinToBitMask(pin))
#define DIRECT_PIN_READ(base, mask)     (((*((base)+8)) & (mask)) ? 1 : 0)

Not sure how to fix that.

Not sure if you resolved this but I updated the encoder lib to use with the minima and wifi, the PR is here back to PJRC: Arduino r4 by mjs513 · Pull Request #96 · PaulStoffregen/Encoder (github.com)

Here is the clean copy from by branch: mjs513/Encoder at Arduino-R4 (github.com)

Cheers

2 Likes

Released that it may not be obvious but for the R4 WiFi there one pin different. These are
are the pins for the WiFi board:
0, 1, 2, 3, 8, 11, 12, 15, 16, 17, 18 and 19

1 Like