Pi Pico doesn't work with GxEPD2 Waveshare 2.9 Module

Hi All,

I am trying to get the Raspberry Pi Pico to work with the GxEPD2 library to use a Waveshare 2.9 Module three color e-ink display.

I am using the GxEPD2_display_selection_new_style.h header to define my display and driver. These are the lines I've selected below.

#define GxEPD2_DISPLAY_CLASS GxEPD2_3C
#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13  128x296, UC8151D, (HINK-E029A10-A3 20160809)
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=*/ EPD_CS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // my proto board

I am using the suggested wiring example and made sure to uncomment the correct line.

I feel like I have everything set up right and no matter what I try the screen is unresponsive when I upload the code. The serial monitor is active, I've pasted it's results below. I have tried two different pico's. I am able to get the library to work with the Arduino Nano RP2040 connect, so I know the screen works and that I am using the right display class and driver. I've checked the voltage output on my pins I am getting 3.3v.

I tried explicitly defining the CS pin as 5 (matching the wiring example) instead of EPD_CS and that didn't help anything either

Not sure what else there is to try.

Thanks for your help.

Here is What I've got in the .ino file:

// base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code

// enable or disable GxEPD2_GFX base class

#define ENABLE_GxEPD2_GFX 0

// #define ARDUINO_RASPBERRY_PI_PICO

// #define ARDUINO_ARCH_RP2040

// uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX

//#include <GFX.h>

// Note: if you use this with ENABLE_GxEPD2_GFX 1:

// uncomment it in GxEPD2_GFX.h too, or add #include <GFX.h> before any #include <GxEPD2_GFX.h>

// #include <Adafruit_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 constructor line in one of the following files (old style):

#include "GxEPD2_display_selection.h"

#include "GxEPD2_display_selection_added.h"

// or select the display class and display driver class in the following file (new style):

#include "GxEPD2_display_selection_new_style.h"

#if !defined(__AVR) && !defined(STM32F1xx)

// note 16.11.2019: the compiler may exclude code based on constant if statements (display.epd2.panel == constant),

// therefore bitmaps may get optimized out by the linker

// comment out unused bitmaps to reduce code space used

// #include "bitmaps/Bitmaps80x128.h" // 1.02" b/w

// #include "bitmaps/Bitmaps152x152.h" // 1.54" b/w

// #include "bitmaps/Bitmaps200x200.h" // 1.54" b/w

// #include "bitmaps/Bitmaps104x212.h" // 2.13" b/w flexible GDEW0213I5F

// #include "bitmaps/Bitmaps128x250.h" // 2.13" b/w

// #include "bitmaps/Bitmaps128x296.h" // 2.9" b/w

// #include "bitmaps/Bitmaps152x296.h" // 2.6" b/w

// #include "bitmaps/Bitmaps176x264.h" // 2.7" b/w

// #include "bitmaps/Bitmaps240x416.h" // 3.71" b/w

// #include "bitmaps/Bitmaps400x300.h" // 4.2" b/w

// #include "bitmaps/Bitmaps648x480.h" // 5.38" b/w

// #include "bitmaps/Bitmaps640x384.h" // 7.5" b/w

// #include "bitmaps/Bitmaps800x480.h" // 7.5" b/w

// 3-color

// #include "bitmaps/Bitmaps3c200x200.h" // 1.54" b/w/r

// #include "bitmaps/Bitmaps3c104x212.h" // 2.13" b/w/r

// #include "bitmaps/Bitmaps3c128x250.h" // 2.13" b/w/r

#include "bitmaps/Bitmaps3c128x296.h" // 2.9" b/w/r

// #include "bitmaps/Bitmaps3c152x296.h" // 2.66" b/w/r

// #include "bitmaps/Bitmaps3c176x264.h" // 2.7" b/w/r

// #include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r

#if defined(ESP8266) || defined(ESP32) || defined(ARDUINO_ARCH_RP2040)

// #include "bitmaps/Bitmaps3c648x480.h" // 5.83" b/w/r

// #include "bitmaps/Bitmaps3c800x480.h" // 7.5" b/w/r

// #include "bitmaps/Bitmaps3c880x528.h" // 7.5" b/w/r

// #include "bitmaps/WS_Bitmaps800x600.h" // 6.0" grey

// #include "bitmaps/WS_Bitmaps4c168x168.h" // 4.37" 4-color

// #include "bitmaps/WS_Bitmaps7c192x143.h" // 5.65" 7-color

//#include "bitmaps/WS_Bitmaps7c300x180.h" // 7.3" 7-color

#endif

#if defined(ESP32)

// #include "bitmaps/Bitmaps1304x984.h" // 12.48" b/w

// #include "bitmaps/Bitmaps3c1304x984.h" // 12.48" b/w/r

// #include "bitmaps/Bitmaps7c800x480.h" // 7.3" 7-color

#endif

#else

// select only one to fit in code space

//#include "bitmaps/Bitmaps80x128.h" // 1.02" b/w

// #include "bitmaps/Bitmaps200x200.h" // 1.54" b/w

//#include "bitmaps/Bitmaps104x212.h" // 2.13" b/w flexible GDEW0213I5F

//#include "bitmaps/Bitmaps128x250.h" // 2.13" b/w

// #include "bitmaps/Bitmaps128x296.h" // 2.9" b/w

//#include "bitmaps/Bitmaps176x264.h" // 2.7" b/w

////#include "bitmaps/Bitmaps400x300.h" // 4.2" b/w // not enough code space

////#include "bitmaps/Bitmaps640x384.h" // 7.5" b/w // not enough code space

// 3-color

//#include "bitmaps/Bitmaps3c200x200.h" // 1.54" b/w/r

//#include "bitmaps/Bitmaps3c104x212.h" // 2.13" b/w/r

// #include "bitmaps/Bitmaps3c128x250.h" // 2.13" b/w/r

#include "bitmaps/Bitmaps3c128x296.h" // 2.9" b/w/r

//#include "bitmaps/Bitmaps3c176x264.h" // 2.7" b/w/r

////#include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r // not enough code space

#endif

#if defined(ARDUINO_ARCH_RP2040) && defined(ARDUINO_RASPBERRY_PI_PICO)

// SPI pins used by GoodDisplay DESPI-PICO. note: steals standard I2C pins PIN_WIRE_SDA (6), PIN_WIRE_SCL (7)

// uncomment next line for use with GoodDisplay DESPI-PICO. // MbedSPI(int miso, int mosi, int sck);

// arduino::MbedSPI SPI0(4, 7, 6); // need be valid pins for same SPI channel, else fails blinking 4 long 4 short

#endif

#if defined(ESP32) && defined(USE_HSPI_FOR_EPD)

SPIClass hspi(HSPI);

#endif

void setup()

{

Serial.begin(115200);

Serial.println();

Serial.println("setup");

delay(100);

#if defined(ARDUINO_ARCH_RP2040) && defined(ARDUINO_RASPBERRY_PI_PICO)

// uncomment next line for use with GoodDisplay DESPI-PICO, or use the extended init method

//display.epd2.selectSPI(SPI0, SPISettings(4000000, MSBFIRST, SPI_MODE0));

// uncomment next 2 lines to allow recovery from configuration failures

pinMode(15, INPUT_PULLUP); // safety pin

while (!digitalRead(15)) delay(100); // check safety pin for fail recovery

#endif

#if defined(ESP32) && defined(USE_HSPI_FOR_EPD)

hspi.begin(13, 12, 14, 15); // remap hspi for EPD (swap pins)

display.epd2.selectSPI(hspi, SPISettings(4000000, MSBFIRST, SPI_MODE0));

#endif

// display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02

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

//display.init(115200, true, 10, false, SPI0, SPISettings(4000000, MSBFIRST, SPI_MODE0)); // extended init method with SPI channel and/or settings selection

// first update should be full refresh

Here's the serial output:

_Update_Part : 10
_Update_Part : 10
_Update_Full : 12
_PowerOff : 11
_PowerOn : 17
_Update_Full : 12
_PowerOff : 11
_PowerOn : 23
_Update_Full : 15
_PowerOff : 9
_PowerOn : 22
_Update_Full : 16
_PowerOff : 10
_PowerOn : 12
_Update_Full : 11
_PowerOff : 12
_PowerOn : 11
_Update_Full : 13
_PowerOff : 7
_PowerOn : 12
_Update_Part : 12
_Update_Part : 10
_Update_Part : 10
_Update_Part : 9
_Update_Part : 9
_Update_Part : 13
_Update_Part : 9
_Update_Part : 10
_Update_Part : 17
_Update_Part : 13
_Update_Part : 16
_Update_Part : 15
_Update_Part : 11
_Update_Part : 13
_Update_Part : 14
_Update_Part : 17
_Update_Part : 16
_Update_Part : 11
_Update_Part : 14
_Update_Part : 14
_Update_Part : 14
_Update_Part : 15
_Update_Part : 11
_Update_Part : 15
_Update_Part : 15
_Update_Part : 13
_Update_Part : 12
_Update_Part : 9
_PowerOff : 9
_PowerOn : 12
_Update_Full : 10
_PowerOff : 12
_PowerOff : 11
_PowerOn : 14
_Update_Full : 14
_PowerOff : 11
_PowerOn : 11
_Update_Full : 13
_PowerOff : 11
_PowerOff : 10
setup done

I think display.epd2.selectSPI selected spi settings may be overrided by display.init, so try use
display.init(115200, true, 10, false, SPI0, SPISettings(4000000, MSBFIRST, SPI_MODE0));
to select SPI setting and initial.

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