Toggle GPIOs faster

Hi,

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) {
SystemSetCpuClk(CLK_KM4_200M);
}

image

Below is the code i am trying to run.

image

1 Like

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

is there an expected timeline?

Regards

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

okay.
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)

2 Likes

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

Hey @xidameng
It had been almost one year for this topic. I want to know if there any conclusion here?
we recently also faced the low sppeed IO toggle issue for RTL8722. Just curious if there is any way to increase the IO toggle speed?

Hi @eric1,

Thanks for your question. Sorry to inform you that actually, @xidameng is no longer with the team.

To answer your question really quickly, there is no way to toggle the GPIO frequency to be faster.
And due to the speed limitation, AmebaD Neo Pixel was connected to the SPI MOSI pin to obtain a faster refreshing rate.