Interrupt by Timer on RP2040

Hello,

I am currently using the Arduino IDE and a Raspberry Pi Pico for a project. I am interested in implementing an interrupt timer functionality similar to the ISR in SAMD or the TCCR in AVR. My goal is to execute a specific function at a fixed frequency of 50kHz, independent of the frequency of the main loop.
Should I use PIO?

Could someone please guide me on whether it's possible to set up and utilize interrupt timers in the context of Raspberry Pi Pico or other RP2040 boards using the ArduinoIDE?
Thanks!

yes, it is possible. See the #hardware_pwm section of the Pico SDK
https://www.raspberrypi.com/documentation/pico-sdk/hardware.html#hardware_pwm

no, you can to setup PWM timers without using the PIO