Waveshare 1.54" display and SAMD based XIAO using GxEPD2

I'm experimenting with a 1.54 inch Waveshare E-ink display and I've managed to get the HellowWorld example sketch to work with an Nano Every, a WEMOS D1 clone and an ESP32-WROOM-32. For some reason I simply cannot get it to work with a SAMD based Seeeduino XIAO. I can get the XIAO to run an SPI based 2.8 inch LCD so I know that my MOSI, SCK, SS (CS), DC, RST, 3V3, GND pin setup is correct. I use the same pin set from the LCD and just add another pin for BUSY on the E-ink display but I can't seem to get it to work. I'm using the same invocation of the constructor:
GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/CS=D4/ D4, /DC=D5/ D5, /RST=D1/ D1, /BUSY=D2/ D2)); // GDEH0154D67
for all 4 boards (with the necessary changes made to the DC, CS, RST and BUSY pins for the board in use) and let the IDE handle the default MOSI, SCK pins. I put printf statements in the code before and after the "helloWorld()" to make sure the sketch runs and I see this:

About to helloWorld
_Update_Full : 3
_Update_Full : 3
Done with helloWorld

I checked the forums and found where it was recommended to use #define GxEPD2_DRIVER_CLASS GxEPD2_150_BN and tried that but I get the same results. I'm probably missing something obvious so if anyone can suggest something I can try I'd appreciate it.

Note: XIAO to E-ink hookup
D10 (MOSI) - DIN
D8 (SCK) - CLK
D2 - BUSY
D4 (SS) - CS
D5 - DC
D1 - RST
GND - GND
3V3 - VCC

Note 2: Just added a Teylenten Robot ESP32-C3 board to the list that I can get working IF you don't select ESP32-C3-DevKitM-1 as the board and choose ESP32-C3-Dev board instead.

Note 3: Finally got the ESP32-C3 Super Mini clones (not the Teylenten boards above) to work with the E-ink display. See below for the CF that turned out to be to get it done.

Too bad we can't see the code or the wiring diagram (hand drawn is fine)

The code is the HelloWorld example from the GxEPD2 libraries with the only change being the direct invocation of the constructor as provided and the addition of two println statements to insure things were working but here's what's in the .ino file:

// GxEPD2_HelloWorld.ino by Jean-Marc Zingg
//
// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines!
//
// Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/
//
// Author: Jean-Marc Zingg
//
// Version: see library.properties
//
// Library: https://github.com/ZinggJM/GxEPD2

// Supporting Arduino Forum Topics (closed, read only):
// Good Display ePaper for Arduino: https://forum.arduino.cc/t/good-display-epaper-for-arduino/419657
// Waveshare e-paper displays with SPI: https://forum.arduino.cc/t/waveshare-e-paper-displays-with-spi/467865
//
// Add new topics in https://forum.arduino.cc/c/using-arduino/displays/23 for new questions and issues

// see GxEPD2_wiring_examples.h for wiring suggestions and examples
// if you use a different wiring, you need to adapt the constructor parameters!

// uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
//#include <GFX.h>

#include <GxEPD2_BW.h>
//#include <GxEPD2_3C.h>
//#include <GxEPD2_4C.h>
//#include <GxEPD2_7C.h>
#include <Fonts/FreeMonoBold9pt7b.h>


// select the display class and display driver class in the following file (new style):
//#include "GxEPD2_display_selection_new_style.h"

// or select the display constructor line in one of the following files (old style):
//#include "GxEPD2_display_selection.h"
//#include "GxEPD2_display_selection_added.h"

// alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h to here

GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D4*/ D4, /*DC=D5*/ D5, /*RST=D1*/ D1, /*BUSY=D2*/ D2)); // GDEH0154D67

// for handling alternative SPI pins (ESP32, RP2040) see example GxEPD2_Example.ino

void setup()
{
  Serial.begin(115200);
  while(!Serial);
  display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
  Serial.println("About to helloWorld");
  helloWorld();
  Serial.println("Done with helloWorld");
  display.hibernate();
}

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

void helloWorld()
{
  display.setRotation(1);
  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.setCursor(x, y);
    display.print(HelloWorld);
  }
  while (display.nextPage());
}

void loop() {};

I'm not sure how much clearer a hand drawn (or otherwise) diagram would help considering I've already provided how the pins from the XIAO are connected to the display. Does this help? Things aren't quite as crowded as the original list of pins.

XIAO ------------------------------- Display
D10 (MOSI) ------------------------- DIN
D8 (SCK) ---------------------------- CLK
D2 ----------------------------------- BUSY
D4 (SS) ----------------------------- CS
D5 ----------------------------------- DC
D1 ----------------------------------- RST
GND --------------------------------- GND
3V3 ---------------------------------- VCC

Hi @clouds33ker , welcome to the forum!

I have found my Seeed XIAO board, but I don't know what processor it has.
And it looks like I never used it so far (no proto-board with connectors for e-paper displays).

Thank you for reporting your success with your other boards!

As your XIAO works with SPI LCD, I don't need to check for SPI pins.
And I know GxEPD2 works with SAMD (MKR1000), but last test was long ago.

My first guess would be a power issue, a weak LDO to the 3.3V pin of the XIAO.
But as your LCD works with it, this is less likely. But you could check the voltage.

I could re-test with my MKR1000, but not today.
-jz-

Thanks for responding. I figured you would as you seem very responsive here in the forums. I appreciate your help and support with the library.

I had wondered about the LDO as I'd seen somewhere else on the forum someone had a problem with a weak USB port supply and using a powered hub fixed the issue but as you pointed out (and as I'd assumed too) that if a back lit LCD could work then the E-ink should also. Just to make sure, I powered the board with 3.3V from a bench top power supply and it still doesn't work. It's frustrating that I can get the other boards to work but not this one. I want to use the XIAO due to it's size, low power and the fact that I have a gazillion different boards and need to start putting them to work. I think I bought them as a 5 pack so I'll see if I can find one of the others and test it or if necessary I'll buy another just to see if the problem is only with this module.

@ZinggJM
OK, I found another of the boards and based on what I'm seeing the problem may lie with the boards themselves. The second board "sort of" works. I upload the sketch and the display flashes a few times and blanks the screen. . . then nothing. "Hello World" never appears even though the serial monitor shows that the helloWorld function completes. I'm seeing something different than before in the serial monitor also. I see this now:

About to helloWorld
_Update_Full : 246969
_Update_Full : 4
Done with helloWorld

About to helloWorld
_Update_Full : 243949
_Update_Full : 3
Done with helloWorld

Does that by chance tell you anything useful?

Yes, it tells me that the full refresh is too short, 240ms instead of about 2 seconds.
This most likely caused by a missing wavetable in OTP. Try GxEPD2_150_BN again.
-jz-

Sometimes I really hate electronics. . .

I had set aside the two XIAO boards and was trying to get an ESP32-C3 Super Mini clone to work with the display. It didn't work and your message came in so I thought I'd try your suggestion. I didn't know which board "sort of" worked so I hooked up one and nothing happened so I pulled it from the breadboard and tried the other to see if it was the one that blinked. I plugged in the USB cable and the blasted thing now works. The display goes through the black/white reset, initialize, whatever and then "Hello World" appears just like it is supposed to. The serial monitor reports:

About to helloWorld
_Update_Full : 2092718
_Update_Full : 2092738
Done with helloWorld

I have no idea what has happened or if it will continue to work but all I can do is try to see if it will now work in my project.

Thank you for your assistance and for all the work you put into the library.

Post created by Jean-Marc Zingg

Avoid using Waveshare e-paper boards with 3.3V processors to avoid such frustrations.

The level converter chip on the board can cause problems with ESP32 strapping pins leading to boot mode problems.

The level converter as such should work fine with 3.3V processor signals, when VCC is fed with 3.3V. It will convert 3.3V signals to 3.3V signals in both ways, with correct sensing levels. But it will cause a load on the input side, with a voltage about half of the 3.3V. This will cause undetermined input e.g. to strapping pins.

I recommend to use e-paper boards without level converters for use with 3.3V processors.

Or use bare e-paper panels with the matching connection module from Good Display, e.g. DESPI-C02, which is my standard use and recommendation.
-jz-

Well. . . crap. . .

The XIAO board I thought was working quit. Both XIAOs have some sort of USB issue as the IDE doesn't recognize them when plugged in and device manager indicates some sort of error regarding unable to recognize connection request. Due to that I went back to trying to figure out the ESP32C3 boards and sort of got them to work but then they too locked up so I was ready to take a hammer to the all of them. I was unaware of the strapping pins so when I looked it up it turns out that for an ESP32C3 pins 2, 8 and 9 are suggested as being left alone due to how they affect the ESP32. Naturally, for the setup I'm using all 3 are being used since the E-ink board needs 6 pins plus Vcc and Gnd to run the board. The board I'm using only has 13 I/O pins available (0-10 and 20, 21). I got the board working at first but after a bit it locked up so I guess I need to try to rearrange pins to get away from 2,8 and 9. What's irritating is that the LCD displays don't have the problems like the E-ink displays. They just work.

I appreciate the help and the information as that saves me more headaches trying to get this to work. I already have over 130 hours in this so I was on the verge of just shutting it down rather than bang my head against the wall and hope things will change.

OK, I just wanted to thank you for your help. I finally have my project functioning using the ESP32C3 Super Mini clone board. I've managed to get an input/output pin setup that seems to work. The ESP32C3 is configured to wake up from deep sleep every 5 minutes to read it's battery status and temperature and then show this on the E-ink display. Now I get to see how long it will run on batteries. Getting away from the strapping pins was the turning point so thank you once again for bringing that to my attention.

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