MKR Wifi 1010 with Waveshare 2.9 inch e-paper

Hi all. I am trying to use the Waveshare 2.9inch epaper display with my MKR wifi 1010 and I can not get it to work.

I have read all the documentation I could find, however, I am not 100% sure I have the wiring correct for SPI on the 1010. I am also not sure the libraries are compatible with the 1010.

Any help someone could provide would be greatly appreciated.

|E-Paper Display | MKR Wifi 1010|

|--- | ---|

|VCC | VCC (3V3)|
|GND | GND|
|DIN | Pin 8|
|CLK | Pin 9|
|CS | Pin 10|
|DC | Pin 11|
|RST | Pin 12|
|BUSY | Pin 13|

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <GxEPD2_BW.h>

// Pin definitions
#define CS_PIN      10 
#define DC_PIN      11  
#define RST_PIN     12  
#define BUSY_PIN    13  

// Create a new e-paper display object
GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(CS_PIN, DC_PIN, RST_PIN, BUSY_PIN));

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // Wait for serial
  }

  Serial.println("Initializing e-paper display..."); //for debugging

  // Initialize SPI
  SPI.begin();

  // Initialize e-paper
  display.init();

  Serial.println("E-paper display initialized."); //for debugging
}

void loop() {
  // Clear the display
  display.fillScreen(GxEPD_WHITE);
  Serial.println("Clear Screen"); //for debugging
  // Set text properties
  display.setTextColor(GxEPD_BLACK);
  display.setTextSize(2); 
  display.setCursor(30, 100); 

  // Display "Hello"
  display.println("Hello");
  Serial.println("Hello"); //for debugging
  // Update the display
  display.display();

  // Delay loop
  delay(10000);
}

Update: I was able to get the Waveshare demo to run on the MKR wifi 1010 using the following pinout. So my wiring is correct now. I think I must be doing something wrong with the implementation of the library. Thanks again.

#define CS_PIN      4 
#define DC_PIN      7  
#define RST_PIN     6  
#define BUSY_PIN    5  

One of these should work with your display:

//#define GxEPD2_DRIVER_CLASS GxEPD2_290     // GDEH029A1   128x296, SSD1608 (IL3820), (E029A01-FPC-A1 SYX1553)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5  // GDEW029T5   128x296, UC8151 (IL0373), (WFT0290CZ10)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D  128x296, UC8151D, (WFT0290CZ10)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_I6FD // GDEW029I6FD  128x296, UC8151D, (WFT0290CZ10)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94  128x296, SSD1680, (FPC-7519 rev.b)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94_V2 // GDEM029T94  128x296, SSD1680, (FPC-7519 rev.b), Waveshare 2.9" V2 variant
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_BS // DEPG0290BS  128x296, SSD1680, (FPC-7519 rev.b)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06  128x296, UC8151D, (WFT0290CZ10)
//#define GxEPD2_DRIVER_CLASS GxEPD2_290_GDEY029T94 // GDEY029T94 128x296, SSD1680, (FPC-A005 20.06.15)

Check the inking on the flexible connector of the panel.

Thanks for the quick response! I noticed those in the GxEPD2_display_selection_added.h on one of the example sketches, but I am afraid it is a little beyond my programming comprehension. So please go easy on me if my methodology is a little strange.

I updated my sketch to add #include the GxEPD2_display_selection_added.h Then copied the whole file into a new tab. I also added the GxEPD2_selection_check.h tab. I then uncommented the display definition in GxEPD2_display_selection_added.h

I am still having trouble getting it to work. Did I do this completely wrong? How do I define the pins used by the display?

Thanks again.

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <GxEPD2_BW.h>

// Pin definitions
#define CS_PIN      4 
#define DC_PIN      7  
#define RST_PIN     6  
#define BUSY_PIN    5  

// Create a new e-paper display object
//GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(CS_PIN, DC_PIN, RST_PIN, BUSY_PIN));  //commented out because the display object should be created in #include "GxEPD2_display_selection_new_style.h"
#include "GxEPD2_display_selection_new_style.h"

Try just to copy the corresponding constructor line from GxEPD2_display_selection_added.h line 155: to replace and uncomment

//GxEPD2_BW<GxEPD2_290_T94_V2, MAX_HEIGHT(GxEPD2_290_T94_V2)> display(GxEPD2_290_T94_V2(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029T94 128x296, SSD1680, Waveshare 2.9" V2 variant

and also the preceding:

#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))

And you may also need:

  display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse

But for learning to use this library, it is best to start with the example GxEPD2_Example.

I have been able to get the display to work now. Thanks so much for the help.

Hi Andrewelee,
I'm interested in your final sketch.
I‘ve a MKR WiFi 1010 and a 1.54“ b/w and
followed your way so far.

I connected the 1.54inch_e-Paper_Module_(B) (black/white/red) to the MKR1010. It works, when I connect the
ePaper VCC --> MKR1010 VCC (+3V3)
It does not work when I connect it to a digital pin . At the Mega Board, it works, when I connect it to a digital pin. I think that the power (current) is not enough.

1.54inch e-Paper Module (B) Manual - Waveshare Wiki