Seeed Xiao ePaper Breakout Board and XIAO ESP32S3 and a GooDisplay 184x88 screen not working with GxEPD2_BW

Thanks for the suggestion!

I was able to find the culprit. The GxEPD2_102 library sets the height in two spots.

Here in the GxEPD2_102.h file:

class GxEPD2_102 : public GxEPD2_EPD
{
  public:
    // attributes
    static const uint16_t WIDTH = 88;
    static const uint16_t WIDTH_VISIBLE = WIDTH;
    static const uint16_t HEIGHT = 184;```

and here in the GxEPD2_102.cpp file as hex values:

void GxEPD2_102::_InitDisplay()
{
  if (_hibernating) _reset();
  _writeCommand(0xD2); // ??
  _writeData(0x3F);
  _writeCommand(0x00); // Panel Setting Register
  _writeData (useOTPforFullRefresh ? 0x4F : 0x6F);   // LUT from OTP or from Registers
  _writeCommand(0x01); // Power Setting
  _writeData (0x03);   // internal VDH/VDL VGH/VGL
  _writeData (0x00);   // VDG_LVL +15,-15
  _writeData (0x2b);   // VDH_LVL +11
  _writeData (0x2b);   // VDL_LVL -11
  _writeCommand(0x06); // Charge Pump Setting
  _writeData(0x3f);    // 50ms, Stength 4, 8kHz
  _writeCommand(0x2A); // LUT Option
  _writeData(0x00);    // no all gate on
  _writeData(0x00);    // 0..5 : 10s, 20..30 : 4.8s
  _writeCommand(0x30); // PLL
  _writeData(0x13);    // 30 Hz
  _writeCommand(0x50); // VCOM and Data interval setting
  _writeData(0x57);    // default
  _writeCommand(0x60); // TCON
  _writeData(0x22);    // 24us
  _writeCommand(0x61); // Resolution Setting
  _writeData(0x58);    // HRES 88 (0x58 in hex)
  _writeData(0xB8);    // VRES 184 (0xB8 in hex)
  _writeCommand(0x82); // Vcom DC Setting
  _writeData(0x12);    // -1 V
  _writeCommand(0xe3); // Power Saving
  _writeData(0x33);    //
}

Appears to be working fine with text now! Just need to set rotation so it prints parallel to the length. This is working code (with the changes to the GxEPD2_102.h and GxEPD2_102.cpp library files in case anyone else wants to use the micro screen with the SEEED Xiao :star_struck::

#include <SPI.h>
#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
// Define pins
#define BUSY_PIN D5
#define RES_PIN D0
#define DC_PIN D3
#define CS_PIN D1
// Define color constants
#define EPD_BLACK 0
#define EPD_WHITE 1
GxEPD2_BW<GxEPD2_102, GxEPD2_102::HEIGHT> display(GxEPD2_102(CS_PIN, DC_PIN, RES_PIN, BUSY_PIN));

void setup() {
  Serial.begin(9600);
  display.init();
  display.setRotation(1); // Rotate display 90 degrees clockwise
}

void loop() {
  display.fillScreen(GxEPD_WHITE);
  display.setTextColor(GxEPD_BLACK);
  display.setFont(&FreeMonoBold9pt7b);
  display.setCursor(20, 20);
  display.print("Hello world!");
  display.display();
  delay(5000);
  display.fillScreen(GxEPD_WHITE);
  display.display();
  delay(5000);
}
1 Like