Arduino Mbed OS RP2040 High Speed GPIO

Hello,

I'm using Raspberry Pi Pico with Arduino Mbed OS environment.
My problem is the general GPIO access time is too slow and so I'm looking for fast method but I can't find yet like as Arduino Platform method.

From
while (1) {
digitalWrite(3, 1);
digitalWrite(3, 0);
}

To
cli();
while (1) {
PORTD |= 0x8;
PORTD &= ~0x8;
}

Is there any method for Pi Pico?

Welcome @kcchang61,

your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

1 Like

Welcome to the forum.

What is slow and what is fast and why you need to make it faster ? We like to know the actual numbers. How many nanoseconds should it be and what is it for ? Can you also give a broader view and tell what your project is about ?

On this forum are sometimes questions about a solution without telling what it is for. That is sometimes a XY problem: https://xyproblem.info/ Therefor we like to know everything.

The ATmega microcontrollers are highly optimized for fast changing of pins. The Raspberry Pi Pico is a processor, meant for doing processor things.

You should be able to access the pico sdk functions like gpio_set_mask()
Like the AVRs, you need to read beyond the arduino docs.

1 Like

Thanks for your comment! The gpio_set_mask(0) method was ultra faster than digitalWrite() function.

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