Toggle GPIOs faster


I am trying to bit bang neopixel protocol. I tried both GPIO and port examples in SDK. But the time it takes to toggle the GPIO is quite high. Around
How can i make if fast. I tried changing the CPU clock. But it did not change anything.

if (wifi_config.wifi_ultra_low_power &&
wifi_config.wifi_app_ctrl_tdma == FALSE) {


Below is the code i am trying to run.


1 Like

someone is working on this at the moment, once there is update, will post it here~

is there an expected timeline?


Roughly in a week or at most two, so stay tuned for update~

Hi, it’s just confirmed with internal team that it is true that toggling from high to low or low to high takes at least 1.5us, so driving neopixel with GPIO might not be a viable option for RTL872XD chips at the moment.

However, you may consider other LED model(such as this) for neopixel which uses SPI protocol which is more robust and faster.

Is this a hardware limitation?
can it be patched somehow by manipulating the GPIO registers directly and bypassing the APIs?

Several tests have been carried out by directly setting the GPIO related registers but the test results stay the same. it’s currently unclear if it’s a hardware limitation or software issue

thanks for the update.
I managed to get the SPI MOSI pinto to generate the required waveform for neo pixels.
But knowing the actual reason for the limitation will be good.

1 Like

Hi @Jitendra_Singh

Glad to hear that! Would you mind sharing this part of your code for the community? someone on this forum is also asking about neopixel and would be very interested in your solution :slight_smile:

We will keep you posted once we hear more from the internal RD team.

Sure. The code implements the low-level function of translating neo pixel byte stream to SPI output.
I am working with this particular IC. Timings for different ICs might differ slighly.

The function accepts a buffer that contains actual RGB values. Each LED needs 3 bytes.

Hope this is helpful. Change the extension to .c
main.xml (4.9 KB)


:star_struck: :+1: :+1: :+1: