hi All, does anyone know how is possible to estimated time of FastLED.show() action

hi All, does anyone know how is possible to estimated time of FastLED.show() action ? I’m using APA102 on ESP module and set the soft SPI to DATA_RATE_MHZ(20), however it seems it took around 300ms or more which is doubtful and so slow ?
any heal really appreciated

You don’t mention how many leds. Also, SPI on the ESP8266 at the moment is bit-bang’d, I haven’t had a chance to implement hardware SPI support yet - so it is going to be slower than on, say, a teensy 3.2.

LED number is 150 and I thinks 300ms is way to high for this amount of LEDs, I did it with Arduino pro mini and it is so faster , ? does repo has DEBUG print or somethings like that so I could check the time in loop?

also I might add I’ve got problem to using the fast reading function such as memcpy and memcpy_P in my sketch

in pre setup
uint8_t * LED_BUFFER;

in setup
LED_BUFFER = (uint8_t )malloc(3NUM_LEDS);

in loop
ESP.flashRead(_index,(uint32_t *)& LED_BUFFER, sizeof(LED_BUFFER));
memcpy_P(leds,LED_BUFFER, sizeof(LED_BUFFER));

with this definition my module get reset and issue following error

Fatal exception 28(LoadProhibitedCause):
epc1=0x4020ffab, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

Exception (28):
epc1=0x4020ffab epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3fff0d70 end: 3fff0f50 offset: 01a0

0x402071bb: loop at read_raw_data.ino line 465
0x4020e908: loop_wrapper at core_esp8266_main.cpp line 56
0x40100718: cont_norm at cont.S line 109

with this number of LEDs, FastLED.show() took place around 1184 us, and I believe it is abnormally high

That’s 8µs per led, or 32 or about 4Mbps which is about what I’d expect bit-bang’d SPI output to be on the esp8266.

As for the problems you’re having with memcpy_P - probably better to ask in the arduino esp8266 forums for what’s going on there.

so you say the 1184 is kindda right for APA1024 using softSPI ? do you have any number for Arduino pro mini and teensy 3.2? it seems it is faster than ESP8266

it’s going to be somewhere in the 2-6Mbps range - I don’t really keep track of the numbers though. I suspect the teensy 3.2 might be faster (gcc seems to optimize for arm better than it does for esp8266). With the pro mini I was able to get just about 1Mbps, I think. Also there’s code in place that tries to slow things down to account for the selected clock rate, and that will often add more wait states than is necessary (in part to make sure that the rate given in DATA_RATE_MHZ isn’t ever exceeded).

When I get some free time I’ll implement hardware SPI support for the ESP8266 - my time is just very limited at the moment so I haven’t gotten to it yet.

Daniel, with help of ESP folks I could enhanced the frame speed from 340 to 240 but still far from 40ms per frame , do you have any suggestion for that ? and as already hardware SPI implemented in ESP lib when will implemented in the FastLED? I’ve check your lib and notice it is already reserved for ESP https://github.com/FastLED/FastLED/blob/master/fastspi.h#L76 , if I pull the request would you help me to implemented

That is for arm hardware SPI - and each arm harwdare platform has its own hardware SPI implementation.

WIthout actually seeing your code (gist/pastebin) I can’t make any other recommendations for improving your time. When you say 40ms per frame, what is it that you mean? A single “frame” of leds is your 150 leds, which takes about 1.184ms to write - or do you mean per “frame” of your POV image? In which case - it’d be helpful to know how many lines each of your POV “frames” have - when you provide only partial information it makes the numbers you do provide mostly meaningless.

(Also - I don’t have the time right now to guide someone else through making the esp8266 hardware SPI work - if I did, I’d have the time to do the work myself)

Hi Hamid. I’ve been doing some timings today (see my other post). Using my wemos D1R2 I think I could update my strip of 144 LEDS 176 times in 313ms. I can check that tomorrow if you want. Maybe we should talk as we seem to be on a similar trajectory.

@Gavin_Morris I suggest to used HW SPI as I did, current fastLED is not fast enough to writing APA102 ,following is the link to this matter https://plus.google.com/u/0/106722914355038967861/posts/QWYCvgiqQe1

I’m only using 50 LEDS at the moment so it is fast enough for my needs. Just in case though, how much speed improvement did you get using HW SPI?