GxEPD2 - Cannot get it to work with Arduino Mega and 2.9 inch flexible e-ink display

I have to admit that I am amateur with both Arduino and e-ink displays. The solution to my problem is probably very simple and I feel embarrassed for not being able to figure it out after spending hours. Thank you in advance for your help!

The display I have is GDEW029I6FD (2.9 inch e ink flexible ultra-thin e-paper display); the driver is e-Paper Driver HAT Rev 2.3 from WaveShare; and the board I have is Arduino Mega (ELEGOO MEGA2560 R3).

I can get my setup to work with the WaveShare demo (https://www.waveshare.com/wiki/2.9inch_e-Paper_HAT_(D)_Manual#Working_With_Arduino), provided that I connect the VCC pin to 3.3V instead of 5V.

I can't get the same setup to work with GxEPD2.

For the GxEPD2_HelloWorld Example, I have tried the following:

  1. Connecting the pins to MEGA according to the wiring example:
// mapping suggestion for Arduino MEGA
// BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51
  1. Selecting the constructor in GxEPD2_HelloWorld.ino with:
#include "GxEPD2_display_selection.h"
#include "GxEPD2_display_selection_added.h"
  1. Selecting the display setting in GxEPD2_display_selection.h, where I uncommented:
#if defined(ARDUINO_AVR_MEGA2560) // Note: SS is on 53 on MEGA
.....
GxEPD2_BW<GxEPD2_290_I6FD, MAX_HEIGHT(GxEPD2_290_I6FD)> display(GxEPD2_290_I6FD(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029I6FD 128x296, UC8151D
....
  1. Selecting reset pulse in the setup() of GxEPD2_HelloWorld.ino:
display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02

The e-paper display remains white after running the code, with the following output from from the Serial Monitor:

15:13:40.826 -> _P5136
15:13:40.826 -> _Update_Full : 12
15:13:40.826 -> _PowerOff : 12
15:13:40.826 -> _PowerOff : 12
15:13:41.740 -> >���.�

Do you know what might be the issue?
Please let me know if you need more information.

@kkk1yyyy, hi, welcome to the forum!

Revision 2.3 has a PWR connection added, which needs to be actively pulled high to enable power to the HAT, controller and e-paper panel. This replaces the "clever" reset circuit used on the older Revision.

I am surprised that it "works" this way, without PWR pulled high. Must be some side-effect of providing power through protection diodes of the level converter.
-jz-
https://www.waveshare.com/wiki/E-Paper_Driver_HAT
E-Paper_Driver_HAT.pdf

Hi ZinggJM,

The display I have might be a knockoff. It was bought from Amazon with no instructions or documentation. I've identified it as GDEW029I6FD based on the part number, though I might be mistaken. This might explain why it is able to operate with 3.3V supplied to the VCC pin.

By the way, thank you for creating the wonderful GxEPD2 library; I hope I can get to use it soon.

No, not if you didn't pull PWR high. Only explainable by supplying power through a data line, e.g. through RST. Take a look at the schematics.

Please confirm if PWR was the issue, and if pulling PWR high, e.g. connect to VCC, did help or not.

Hi ZinggJM,

I have tried to connect the VCC pin to the 5V instead of the 3.3V pin on the MEGA and that did not seem to work. I am sorry if this is not what you are asking; I don't think I fully understand what do you mean by "pulling PWR high" and you are probably right that power might be supplied by RST pin.

Do you have any resources that I can read into to improve my understanding?

Thanks.

Yes, I provided the link to the Waveshare wiki page. Here again: https://www.waveshare.com/wiki/E-Paper_Driver_HAT.

If you don't connect the PWR line to VCC, then VCC is not fed to the rest of the HAT and the panel. Alternately you can drive it by a processor pin, to enable power to the HAT and panel.
Try to read and understand the schematics.

Maybe some other electronics expert can explain it better to you.
-jz-

Hi ZinggJM,

I have indeed followed the wiki for Arduino Mega connections.

With that said, I had to connect the VCC pin to the 3.3V instead of the 5V power to get the WaveShare Arduino demo (epd2in9d) to work.

The display remains white and unresponsive with the instructed 5V, and I don't know why that is the case.

Is my hardware defective?

Aside from the hardware issue, is my code correct for GxEPD2?

Thank you in advance!

Does your e-Paper Driver HAT have a pin labelled PWR, next to BUSY?
This is not the same as the pin labelled VCC

Hi toddnz,

Yes, there is a PWR pin and it is connected to D6 for the WaveShare demo.

By the way, I noticed that the wiki link ZinggJM sent has no PWR connection but two BUSY connections for Arduino.

In contrast, the wiki I initially followed has PWR to D6.

Is the double BUSY connection intentional? Would that be a source of my problem?

Thank you in advance for your help!

I have little experience with Waveshare displays, but I'll do my best to relay information I have overheard.

I am not immediately sure exactly why the BUSY connection is shown twice, possibly even a typo.

I am fairly sure that this is the source of your problem.


With Rev 2.2, the Waveshare e-Paper Driver HAT had a non-standard RST pin. I don't know the details, but I believe it tried to do two different jobs, resetting the display and switching power on/off. It seemed to be a headache for all involved.

I believe that Rev 2.3 is the first model to have a seperate PWR pin. Now the RST pin is free to act normally, and the power on/off is controlled by the new PWR pin.


In the waveshare demo, the Arduino is setting D6 HIGH on LOW to switch the display power on / off.

It is possible for you to write your own code to do the same, however you can simply leave the display powered on, by connecting the PWR pin to 3.3V.

ZinggJM explained most of this earlier in the post, I think there was just a small gap that hadn't quite connected. Hopefully now it all makes sense if you do go back through the post.

Hi Toddnz,

That makes a lot sense! Thank you for your detailed explanation.

I will give it a try later today.

Best regards,
Kuo

Hi ZinggJM and toddnz,

Thank you so much!

Hurray! I managed to get the HelloWorld example to work by connecting both VCC and PWR to 5V.

It might be interesting to note that this way of connecting doesn't seem to work reliably for the WaveShare demo (epd2in9d). It fails about half of the time, where the screen would black out and refuse to refresh. On the other hand, if I connect the VCC to 3.3V for this demo, it works every time.

Again, thank you both for your help!

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