Waveshare e-paper SPI display 7.8" 1872 x 1110 vs 1404

I am not able to make this new Waveshare 7.8" e-paper display with IT8951 Driver Hat display larger than 1872 x 1123. (using esp32 - WEMOS Lolin32)
Using GxEPD2_it78_1872x1404 appears to hang at display initialization.
I have it working with GxEPD2_it78_1872x1404 editing HEIGHT line to be

  • static const uint16_t HEIGHT = 1123; // was 1404

See my adaptation of GxEPD2_HelloWorld.ino by Jean-Marc Zingg
Hints on what I am missing would be greatly appreciated.

ps. Many thanks to JMZingg for their generous contributions to this world.

// File HelloWorld4b based on example
// GxEPD2_HelloWorld.ino by Jean-Marc Zingg
//

#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
enum alignment {LEFT, RIGHT, CENTER};
#define GxEPD2_DISPLAY_CLASS GxEPD2_BW
#define GxEPD2_DRIVER_CLASS GxEPD2_it78_1872x1404 // ED078KC2 1872x1404
#define MAX_DISPLAY_BUFFER_SIZE 65536ul //
GxEPD2_BW < GxEPD2_it78_1872x1404, GxEPD2_it78_1872x1404::HEIGHT / 4 > display(GxEPD2_it78_1872x1404(/*CS*/ 16, /*DC*/ 2, /*RST*/ 15, /*BUSY*/ 4));

void setup()  {
  Serial.begin(115200);
  delay(500); //
  Serial.println("start setup");
  display.init();
  helloWorld();
  display.hibernate();
}

const char HelloWorld[] = "Helloo World!";

void helloWorld()  {
  display.setRotation(0);
  display.setFont(&FreeMonoBold9pt7b);

  display.setTextColor(GxEPD_BLACK);
  int16_t tbx, tby; uint16_t tbw, tbh;
  display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  // center the bounding box by transposition of the origin:
  uint16_t x = ((display.width() - tbw) / 2) - tbx;
  uint16_t y = ((display.height() - tbh) / 2) - tby;
  display.setFullWindow();
  display.firstPage();
  do
  {
    display.fillScreen(GxEPD_WHITE);
    display.setTextSize(3);      //text size multiplier
    display.setCursor(x, y);
    display.print(HelloWorld);
  }
  while (display.nextPage());
}

void loop() {};

Testing on both GxEPD2 versions 1.3.8 and today on 1.3.9 show similar result (hang at initialization after upload).

NB. My real application is a variation of the weather station display. That one hangs in a similar fashion.

As delivered GxEPD2 upload/restart hangs as below
10:27:28.619 -> start setup
10:27:31.648 -> VCOM = -1.50V
10:27:31.648 -> VCOM = -1.50V
(the initialization process just hangs here, no screen refresh)

Manually editing GxEPD2_it78_1872x1404.h Reduced screen height to 1123 and it works
10:25:25.451 -> start setup
10:25:28.541 -> VCOM = -1.50V
10:25:28.541 -> VCOM = -1.50V
10:25:37.851 -> Display complete (screen refreshes properly)

( all good from here...)

My revised sketch adding the 'Display complete' line to setup() to show initialization complete

// File HelloWorld4b based on example
// GxEPD2_HelloWorld.ino by Jean-Marc Zingg
//

#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
enum alignment {LEFT, RIGHT, CENTER};
#define GxEPD2_DISPLAY_CLASS GxEPD2_BW
#define GxEPD2_DRIVER_CLASS GxEPD2_it78_1872x1404 // ED078KC2 1872x1404
#define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g.
//GxEPD2_BW < GxEPD2_it60_1448x1072, GxEPD2_it60_1448x1072::HEIGHT / 4 > display(GxEPD2_it60_1448x1072(/*CS*/ 16, /*DC*/ 2, /*RST*/ 15, /*BUSY*/ 4));
GxEPD2_BW < GxEPD2_it78_1872x1404, GxEPD2_it78_1872x1404::HEIGHT / 4 > display(GxEPD2_it78_1872x1404(/*CS*/ 16, /*DC*/ 2, /*RST*/ 15, /*BUSY*/ 4));

void setup()  {
  Serial.begin(115200);
  delay(500); //
  Serial.println("start setup");
  display.init();
  helloWorld();
  display.hibernate();
  Serial.println("Display complete");
}

const char HelloWorld[] = "Hello Worldd!";

void helloWorld()  {
  display.setRotation(0);
  display.setFont(&FreeMonoBold9pt7b);

  display.setTextColor(GxEPD_BLACK);
  int16_t tbx, tby; uint16_t tbw, tbh;
  display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  // center the bounding box by transposition of the origin:
  uint16_t x = ((display.width() - tbw) / 2) - tbx;
  uint16_t y = ((display.height() - tbh) / 2) - tby;
  display.setFullWindow();
  display.firstPage();
  do
  {
    display.fillScreen(GxEPD_WHITE);
    display.setTextSize(3);      //text size multiplier
    display.setCursor(x, y);
    display.print(HelloWorld);
  }
  while (display.nextPage());
}

void loop() {};

@kspear_aus, Hi, welcome to the forum! Thank you for having used code windows.

Don't you see the error?

ESP32 hangs if more than 64k RAM is used.

I invite new users to use the GxEPD2_Example unmodified, except for display selection and wiring parameters.

From GxEPD2_display_selection.h:

// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 16, CS -> SS(5), SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
// note: 5V supply needs to be exact and strong; 5V over diode from USB (e.g. Wemos D1 mini) doesn't work!
//GxEPD2_BW<GxEPD2_it60, GxEPD2_it60::HEIGHT> display(GxEPD2_it60(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_BW < GxEPD2_it60_1448x1072, GxEPD2_it60_1448x1072::HEIGHT / 4 > display(GxEPD2_it60_1448x1072(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_BW < GxEPD2_it78_1872x1404, GxEPD2_it78_1872x1404::HEIGHT / 8 > display(GxEPD2_it78_1872x1404(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));

or from GxEPD2_display_selection_new_style.h:

#if defined(ESP32)
#define MAX_DISPLAY_BUFFER_SIZE 65536ul // e.g.
#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS)
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
#elif IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS)
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8))
#elif IS_GxEPD2_7C(GxEPD2_DISPLAY_CLASS)
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2))
#endif
// adapt the constructor parameters to your wiring
#if !IS_GxEPD2_1248(GxEPD2_DRIVER_CLASS)
#if defined(ARDUINO_LOLIN_D32_PRO)
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15));
#elif defined(ARDUINO_ESP32_DEV) // e.g. TTGO T8 ESP32-WROVER
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4));
#else
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
#endif
#else // GxEPD2_1248
// Waveshare 12.48 b/w SPI display board and frame or Good Display 12.48 b/w panel GDEW1248T3
// general constructor for use with all parameters, e.g. for Waveshare ESP32 driver board mounted on connection board
GxEPD2_BW < GxEPD2_1248, GxEPD2_1248::HEIGHT / 4 > display(GxEPD2_1248(/*sck=*/ 13, /*miso=*/ 12, /*mosi=*/ 14,
    /*cs_m1=*/ 23, /*cs_s1=*/ 22, /*cs_m2=*/ 16, /*cs_s2=*/ 19,
    /*dc1=*/ 25, /*dc2=*/ 17, /*rst1=*/ 33, /*rst2=*/ 5,
    /*busy_m1=*/ 32, /*busy_s1=*/ 26, /*busy_m2=*/ 18, /*busy_s2=*/ 4));
#endif
#endif

Jean-Marc

PS: I will ask moderators to move this topic to the Displays section, where I would have noticed.

Thank you for taking time to reply on this and getting it shifted to the correct place.
I am learning slowly.

Cheers,

I just discovered that there are 3 lines missing in GxEPD2_selection_check.h:

#define GxEPD2_it60_IS_BW true
#define GxEPD2_it60_1448x1072_IS_BW true
#define GxEPD2_it78_1872x1404_IS_BW true

This will be fixed in the next release.

Jean-Marc

I am very happy to report that I am now able to write to my entire 1872x1404 screen.
Yes, it was as simple as learning to use paging to work around the esp32 memory limitation.
Your new library examples helped me with finally get my head around paging. It seems so obvious now. Thank you Jean-Marc.

liked the way you expressed your views in this post.
Wholesale capacitive touch screen suppliers

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