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);
}
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.
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.
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
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)