Hi
I figured this one deserved a thread of its own, even though it is sprung out of another thread.
I am running a Seeed XIAO RP2040, neat little thing, with a 1.54" BW Waveshare display.
I am doing fast partial updates, but they are not as quick as I expected, or wanted, considering the spec says 0.3 seconds for a fast partial update. My goal is < 0.8 seconds. Which seems conservative enough considering the spec.
I made an analysis of the time-consumption of the various code parts, no surprise really, but a bit interesting anyway, IMO
See the code with times in the code-sections below
The partial window in the first case is approx 200x45
In the second case, with two setcursor/print it is approx 200x120
Interestingly enough it takes way less than twice the time when the partial window is more than twice the size! Total time in first case is 898ms, when the partial window is increased to more than double, and there's an extra print in the loop, the extra time is still just 21ms. So whatever consumes the bulk of the time, apparently is not the data-transfer.
These tests were all run with a full frame buffer, i.e. the do-while loop was only run once.
(Which reminds me to remove it, as it is not needed in my case).
The surprising thing is the hibernation, it takes 142ms to set the display in hibernation.
So two questions arises, in my head at least
- How much of the time consumed is SPI-overhead?
- Considering the spec says 300 ms for a fast partial updated, why does it in reality take 894ms, looking at only the update part in the end. I mean, you can do fast partial updates of a full screen, which is commonly recommended, so that's what I would expect the spec info to relate to, 0.3 seconds for a full screen fast partial update.
display.setPartialWindow(0, y1, 200, 200 - y1); // < 1ms
display.firstPage(); // < 1ms
do { // The do-while takes 898ms with only one setcursor/print (second commented out)
display.fillScreen(GxEPD_WHITE); // < 1ms
display.setCursor(x1, y1 - yadv1); // < 1ms
display.print(lastresbufptr); // 4ms
// display.setCursor(x2, y2 - yadv2);
// display.print(prevresbufptr);
} while (display.nextPage()); // 894ms, this is where "all" the time is consumed
display.hibernate(); //142ms, that's a lot to just set it in hibernate!
display.setPartialWindow(0, y2, 200, 200 - y2);
// display.setPartialWindow(0, y1, 200, 200 - y1); // < 1ms
display.firstPage(); // < 1ms
do { // The do-while takes 898ms/922 with one/two setcursor/print, only 24ms difference
display.fillScreen(GxEPD_WHITE); // < 1ms
display.setCursor(x1, y1 - yadv1); // < 1ms
display.print(lastresbufptr); // 4ms
display.setCursor(x2, y2 - yadv2); // < 1ms
display.print(prevresbufptr); // 3ms
} while (display.nextPage()); // 894ms/915ms with one/two setcursor/print! This is where "all" the time is consumed
display.hibernate(); //142ms, that's a lot to just set it in hibernate!