GxEPD2 Partial refresh takes 3 seconds instead of 0.3 seconds. How come?

Hi

When reading the Waveshare spec (link below) on my display, it says partial refresh takes 0,3 seconds, but when I do a partial refresh, it takes almost exactly 3 seconds.

Here's the code-section with the partial refresh. Am I doing something wrong? How can I make it go so much faster?

I am basically just running this over and over again and printing the milliseconds since last update.

Thanks!



  // Calculate textposition and partial window to update
  display.setFont(&FreeSansBold24pt7b);
  display.getTextBounds(lastresbufptr, 0, 0, &x1, &yadv1, &w1, &h1);
  x1 = (200 - w1) / 2;
  y1 = 160;
  w1 = 200; h1 = 200-y1;

  display.getTextBounds(prevresbufptr, 0, 0, &x2, &yadv2, &w2, &h2);
  x2 = (200 - w2) / 2;
  y2 = 80;
  w2 = 200; h2 = h2+3;

  // Update display
  display.setPartialWindow(0, y2, 200, 200-y2);

  display.firstPage();
  do {
    display.fillScreen(GxEPD_WHITE);

    display.setCursor(x1, y1 - yadv1);
    display.print(lastresbufptr);
    
    display.setCursor(x2, y2 - yadv2);
    display.print(prevresbufptr);

  } while (display.nextPage());
  display.hibernate();

Here's the link to the waveshare product webpage with the info on partial update timing.

" * Partial refresh time: 0.3s"

Ok, so the do-while is run 13 times. If each of those is 0.3 seconds, it explains the thing.

And the reason it is run 13 times is, if I understand things correctly, because the memory of my Pro Micro is not large enough to fit the frame-buffer for the partial window in one go.

Correct?

But I just got a Pi Pico, so I might try that one instead then, to see if that one will work better.

How come?

Complaining may get you nowhere. But providing diagnostic output may get you some help.
Diagnostic output may even help you see what happens.
Diagnostic output from Serial Monitor should be shown in a code window.

My post contains information, code and questions, no complaints.

The Pro Micro doesn't support Serial monitor.

Correct! Known as "paging".

The size of these "slices" is set by the "page height". You set this when declaring your display:

GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=*/ 9, /*DC=*/ 8, /*RST=*/ 12, /*BUSY=*/ 13));

(source)

Note the MAX_HEIGHT(GxEPD2_DRIVER_CLASS) argument in there. This sets page height to the same as the display height, meaning you only use one page. This will only work if your device has enough RAM (like the Pi Pico)

If you wanted to, for some reason, you could also manually set a different page height there.

1 Like

I believe Waveshare is only counting the time taken for the display image to change, not any time you take rendering / transferring the image.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.