Help with WaveShare EPaper Display with Adafruit HUZZAH32 ESP32 Feather Board

I’m trying to understand how I could use WaveShare EPaper Display with Adafruit HUZZAH32 ESP32 Feather Board.

With these connections

SDI/SCK -> MOSI
SCK/SCLK -> SCK
CS -> 15
DC -> 33
RST/Reset -> 27
Busy -> 32

and this code

#include <GxEPD.h>
#include <GxGDEP015OC1/GxGDEP015OC1.cpp>    // 1.54" b/w
#include <GxIO/GxIO_SPI/GxIO_SPI.cpp>
#include <GxIO/GxIO.cpp>
#include <Fonts/FreeSansBold24pt7b.h>

GxIO_Class io(SPI, 15, 33, 27);
GxEPD_Class display(io, 27, 32);

const char* name = "FreeSansBold24pt7b";
const GFXfont* f = &FreeSansBold24pt7b;


void setup() {
  randomSeed(analogRead(0));
  Serial.begin(9600);
  Serial.println("Starting...");
  display.init(9600);
  //display.setRotation(1);
  display.fillScreen(GxEPD_BLACK);
  display.setFont(f);
  display.update();
  delay(2000);
}

void loop() {
  Serial.println("showing randon number...");
  showRandomNumber();
  delay(2000);
}

void showRandomNumber() {
  String randomString = String(random(1, 60));

  uint16_t box_x = 60;
  uint16_t box_y = 60;
  uint16_t box_w = 90;
  uint16_t box_h = 100;
  uint16_t cursor_y = box_y + 16;

  display.setRotation(45);
  display.setFont(f);
  display.setTextColor(GxEPD_BLACK);

  display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  display.setCursor(box_x, cursor_y+38);
  display.print(randomString);
  display.updateWindow(box_x, box_y, box_w, box_h, true);

}

but I don’t get any reaction from the display, do you see something wrong in the code or the connections?

thanks a lot for your help

References
https://github.com/dgarrett/BasicEPaperReader

https://github.com/juanpabloaj/esp32_waveshare/blob/master/01_update_window/01_update_window.ino

@juanpabloaj,

When asking for help, you should always post links to the devices in question, display and processor board.

Then I can check if your display is supported, and selected correctly in your code.

Post diagnostic output from Serial Monitor; this can help to analyze your issue.

A picture is always helpful! If I look at your picture, it seems you connected BUSY to pin 2, not 32.

Note that with ESP32 and ESP8266 you can use almost any pin for CS, but you can't use the SS pin for anything else if you use HW SPI.

See in C:\Users\xxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.1\variants\feather_esp32\pins_arduino.h:

static const uint8_t SS    = 2;
static const uint8_t MOSI  = 18;
static const uint8_t MISO  = 19;
static const uint8_t SCK   = 5;

Good Luck!

Thanks ZinggJM,

I'm using

Adafruit HUZZAH32 – ESP32 Feather Board

with

Waveshare 200x200, 1.54inch E-Ink display module, SPI interface
https://www.waveshare.com/wiki/1.54inch_e-Paper_Module

I have connected BUSY to pin 32 (that information was hidden in the last picture)

Sorry if my questions are too basic, I'm a newbie.

Thanks again for your help.

From the serial monitor, I'm getting this

⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮_PowerOn : 5
_Update_Full : 1
_PowerOff : 1
showing randon number...
_PowerOn : 1
_Update_Part : 1
showing randon number...
_PowerOn : 1
_Update_Part : 1

I should have seen in pins_arduino.h that A7 is 32.

BUSY times near zero could mean BUSY stuck at inactive, or SPI doesn't work, or display gets constant reset or no power. With BUSY stuck at inactive you would still see some reaction on the screen.

Make sure the connector to the display is firmly pushed in. You could measure continuity from the display to the processor; sometimes DuPont connectors are not good.

I don't have a HUZZAH32, so I can't check.

You could try the connections vertigo72 used in this post.

I tried the connections of vertigo72

GxIO_Class io(SPI, 21, 23, 22);
GxEPD_Class display(io, 22, 17);

without getting a different result.

Usefull information

I manage to get a working e-paper with Adafruit HUZZ32AH Feather (Expressif ESP-WROOM-32) with Wareshare 2.9" E-Ink display B&W (296x128).

I use the following connection :

static const uint8_t EPD_BUSY = 32; // to EPD BUSY
static const uint8_t EPD_CS = 15; // to EPD CS
static const uint8_t EPD_RST = 27; // to EPD RST
static const uint8_t EPD_DC = 33; // to EPD DC
static const uint8_t EPD_SCK = 5; // to EPD CLK
static const uint8_t EPD_MISO = 19; // Master-In Slave-Out not used, as no data from display
static const uint8_t EPD_MOSI = 18; // to EPD DIN

I tested connectivity with the program ESP32-e-Paper-Weather-Display using a 2.9" Waveshare e-paper.

Hope it helps

frd2002 - thank your for the helpful post.

I spent quite a bit of time trying to get the Adafruit ESP32 Feather to work with a waveshare display. Your pinout worked. I believe the key is waveshare DIN goes to Adafruit MOSI and waveshare CLK goes to Adafruit SCK.

I could not get any of the GxEPD or GxEPD2 sample code to work on the waveshare 2.9 inch display. I’m a novice programmer and the compiler code in the samples is beyond my abilities, so I may be doing something wrong with respect to “uncommenting" the sample code to enable the necessary features for the display.

Based on the ESP32-e-Paper-Weather-Display code, I created a simple “Hello World” sketch for the 2.9 inch display. This code works.

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

// Connections for Adafruit ESP32 Feather
static const uint8_t EPD_BUSY = 32;  // to EPD BUSY
static const uint8_t EPD_CS   = 15;  // to EPD CS
static const uint8_t EPD_RST  = 27; // to EPD RST
static const uint8_t EPD_DC   = 33; // to EPD DC
static const uint8_t EPD_SCK  = 5; // to EPD CLK
static const uint8_t EPD_MISO = 19; // Master-In Slave-Out not used, as no data from display
static const uint8_t EPD_MOSI = 18; // to EPD DIN

GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(EPD_CS, EPD_DC, EPD_RST, EPD_BUSY));

void setup() {

  // Initialize SPI
  SPI.begin(EPD_SCK, EPD_MISO, EPD_MOSI, EPD_CS);

  // Initialize display and font
  display.init();
  display.setRotation(3);     // landscape orientaion 
  display.setFullWindow();  
  display.setFont();
  display.setTextColor(GxEPD_BLACK, GxEPD_WHITE); 
  display.setTextSize(4);

  // Write something to display buffer
  display.fillScreen(GxEPD_WHITE); 
  display.setCursor(2, 20); 
  display.print("Hello World!"); 

  // Update display
  display.display();
}

void loop() {
  // These aren't the droids you're looking for. 
}

Did you try uncommenting this line:

//GxEPD2_BW<GxEPD2_290_T5, GxEPD2_290_T5::HEIGHT> display(GxEPD2_290_T5(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5

it is for a newer panel. Adapt the parameters for you wiring.

Jean-Marc,

Yes, In the GxEPD2_Example from the GxEPD2 library I uncommented that line and added the same pin connections as in my Hello World code above.

GxEPD2_BW<GxEPD2_290_T5, GxEPD2_290_T5::HEIGHT> display(GxEPD2_290_T5(/CS=5/ 15, /DC=/ 33, /RST=/ 27, /BUSY=/ 32)); // GDEW029T5

The code compiles and downloads but nothing happens on the screen. No screen update or blinking.

Robert

@RobertLL

Hi Robert,

forget my last post, I had misunderstood your post.

I didn't notice your

This code works.

The standard HW SPI pins of the ESP32 processors are as in:

C:\Users\xxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\variants\esp32\pins_arduino.h

static const uint8_t SS    = 5;
static const uint8_t MOSI  = 23;
static const uint8_t MISO  = 19;
static const uint8_t SCK   = 18;

Adafruit ESP32 Feather uses different pins, maybe to make it pin-compatible with other boards:

C:\Users\xxx\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\variants\feather_esp32\pins_arduino.h

static const uint8_t SS    = 33;
static const uint8_t MOSI  = 18;
static const uint8_t MISO  = 19;
static const uint8_t SCK   = 5;

SPI.begin() without parameters uses the pins according to the board selected, as defined in pins_arduino.h.
The SPIClass uses the pin remapping feature of the ESP processor, if the pins differ from the HW pins.

By calling SPI.begin(EPD_SCK, EPD_MISO, EPD_MOSI, EPD_CS); with explicit pin numbers, different from the HW pins, the same remapping takes place.

Because SPI.begin(EPD_SCK, EPD_MISO, EPD_MOSI, EPD_CS); is called before display.init(), the SPI.begin() called inside display.init() will fail, keeping the values of the previous init.
This is why your code works.

It is still unclear why some pins on the Adafruit ESP32 Feather can be used, and others can't.

But you and frd2002 have found pins that work to connect e-papers. Thank you!

Jean-Marc

@ZinggJM

Jean-Marc,

Thanks for the helpful info! It appears that the correct pin mapping is in the ....feather_esp32\pins_arduino.h file.

So, I took out the SPI.begin(EPD_SCK, EPD_MISO, EPD_MOSI, EPD_CS) line in my Hello World sketch and just relied on display.init() to initialize SPI. And it works.

My last question is if this works why doesn't the GxEPD2_Example work on the Feather ESP32? It should be initializing the same way correct?

Robert

Robert,

The reason seems to be your pin use for DC (33). It is in conflict with the default for SS (33).

With your SPI.begin(…) you remap SS and avoid that conflict.

You can use any pin for CS, but you can’t use the SS pin for anything else.

The reason for this is the optional use of “use HW CS” void setHwCs(bool use);.
I think either the SPIClass initializes SS in any case, or the HW requires this in any case.

But I am confused if your example works without remap.

Jean-Marc

I think I shouldn’t respond to this topic anymore, unless someone donates one of these overpriced nonstandard esp32 boards.
Else it is a total waste of time.

Jean-Marc

Hi Robert,

Im having the same issue as you! The code compiles and downloads, but nothing happens on the screen. I borrowed your code, hope that’s okay. I need to display different statements on the display, but again, I can’t seem to connect to the display. I have tried everything and looked at different forums for answers. How did you get your screen to work? I hope you can help me. I have added the code + setup.

Kind regards,
Naja

#include <GxEPD2_BW.h>
#include <Fonts/FreeMono12pt7b.h>

// Connections for Adafruit ESP32 Feather
static const uint8_t EPD_BUSY = 32; // Ada 32 to EPD BUSY
static const uint8_t EPD_CS = 15; // Ada 15 to EPD CS
static const uint8_t EPD_RST = 27; // Ada 27 to EPD RST
static const uint8_t EPD_DC = 33; // Ada 33 to EPD DC
static const uint8_t EPD_SCK = 5; // Ada 5 to EPD CLK
static const uint8_t EPD_MISO = 19; // Master-In Slave-Out not used, as no data from display
static const uint8_t EPD_MOSI = 18; // Ada 18 to EPD DIN

//Include the appropriate line from the ‘GxEPD2_Example’ code for your particular display.
//This works for the 2.9 inch black and white display. Add pin numbers.
GxEPD2_BW<GxEPD2_213_flex, GxEPD2_213_flex::HEIGHT> display(GxEPD2_213_flex(/CS=5/SS, /DC=/ 33, /RST=/ 27, /BUSY=/ 32));

void setup() {

// Initialize display and set font
display.init();
display.setRotation(3); // landscape orientaion
display.setFullWindow();
display.setFont(&FreeMono12pt7b);
display.setTextColor(GxEPD_BLACK, GxEPD_WHITE);

// Write something to display buffer
display.fillScreen(GxEPD_WHITE);
display.setCursor(2, 20);
display.print(“Hello World!”);

// Update display
display.display();
}

void loop() {
// These aren’t the droids you’re looking for.
}

No, or only by chance. You use a constructor for a 2.13" e-paper display.
GxEPD2 doesn’t support the 2.9" flex e-paper display. It might work per chance, Iif the display you select has the same controller.

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