I'm trying to get the Waveshare 5.79" e-paper display (black & white, SPI) working with a Raspberry Pi Pico using the GxEPD2 library. The display remains blank during updates as I'm trying to run the HelloWorld example.
I see serial output and _Update_Full debug logs from the library, which suggests communication with the display driver is happening, but nothing appears on the screen.
Display Details
- Module: Waveshare 5.79" e-Paper Display Module
- Panel: GDEY0579T93
- Resolution: 792×272
- Controller: SSD1683
- Interface: SPI
- Voltage: 3.3V logic and power
Wiring
Using hardware SPI (SPI0) on the Pico, using suggested wiring from wiring examples:
| Display Pin | Pico GPIO |
|---|---|
| VCC | 3V3 |
| GND | GND |
| DIN (MOSI) | GP3 |
| CLK (SCK) | GP2 |
| CS | GP5 |
| DC | GP8 |
| RST | GP9 |
| BUSY | GP7 |
GxEPD2 Settings
In GxEPD2_display_selection_new_style.h:
#define GxEPD2_DISPLAY_CLASS GxEPD2_BW
#define GxEPD2_DRIVER_CLASS GxEPD2_579_GDEY0579T93
And for the Pico, the constructor is:
#if defined(ARDUINO_RASPBERRY_PI_PICO)
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)>
display(GxEPD2_DRIVER_CLASS(/*CS=*/ 5, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
#endif
Serial output looks like this:
Serial is ready
startting setup
before init
after init
_Update_Full : 5
_Update_Full : 4009
0 test
_Update_Full : 1
1 test
_Update_Full : 2002
2 test
_Update_Full : 11011
Full sketch that I'm running:
#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
// e.g. for Wemos D1 mini:
//GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67
// for handling alternative SPI pins (ESP32, RP2040) see example GxEPD2_Example.ino
#ifndef ARDUINO_RASPBERRY_PI_PICO
#error "Incorrect board selected; please choose 'Raspberry Pi Pico' in the Arduino IDE."
#endif
//#if defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_W)
//GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)>
// display(GxEPD2_DRIVER_CLASS(/*CS=*/ 5, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
//#endif
const int ledPin = 25;
int i = 0;
void setup()
{
while (!Serial) delay(10); // Wait for Serial to be ready
Serial.println("Serial is ready");
pinMode(ledPin, OUTPUT);
analogWrite(ledPin, 200);
Serial.begin(9600);
Serial.println("starting setup");
//display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02
delay(1000);
Serial.println("before init");
display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
//display.init(115200, true, 10, false, SPI, SPISettings(4000000, MSBFIRST, SPI_MODE0));
Serial.println("after init");
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() {
Serial.print(i);
Serial.println(" test");
helloWorld();
delay(2000);
i++;
};