AVRtimers on RP2040

Hey everyone,
I have a project that is currently using Arduino MEGA 2560 because of its high pin count. I have decided that I'd like to try using RP2040 with a couple TCA9555 IO expander ICs instead.

I use the IRremote library and one snag that I came across is that its default configuration uses TIMER1 which conflicts with PWM on some of the pins I used. To resolve this I used #define IR_USE_AVR_TIMER5 to avoid this conflict.

Will something similar be possible with the RP2040? I know that MEGA2560 has more timers than regular Arduinos and I read that RP2040 does something different with timers.

I would be very appreciative if someone could offer some advice/words of wisdom on this, please.

All the best,
Dax.

The RP2040 is an ARM processor - completely different from AVR. AVR options will not work. You need to configure for ARM architecture.

1 Like

have a look at the RPI_PICO_TimerInterrupt library

1 Like

Thanks @horace. I really only need 6 PWM outputs, does that mean I could dedicate the hardware timer to IRremote? Pi Pico seems to have plenty of GPIO pins for that, then the IO expanders could handle the button inputs and outputs to two ULN2003A relay driver ICs.

Am I making any sense?

You don't need to worry about timers and PWM with RP2040 & IRremote.
See the README at https://github.com/Arduino-IRremote/Arduino-IRremote (search for RP2040).

1 Like

Ahh,that's great to know. Thank you so much for the info. :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.