Go Down

Topic: Waveshare e-paper displays with SPI (Read 32727 times) previous topic - next topic

ZinggJM

Jul 02, 2017, 12:01 pm Last Edit: Aug 25, 2017, 07:09 am by ZinggJM Reason: added GxGDEH029A1 2.9inch
Hi E-Paper Fans

Waveshare has extended their range of small e-papers with SPI interface.

These e-paper displays are quite easy to use, and Waveshare has wiki pages for them with complete information, schematics, pdf specification, and code example.

Be aware of the difference between e-papers and TFTs: update of e-papers is rather slow, ~1s, so they make sense for slowly changing information.

E-paper display keep showing the information when powered off, and consume little power on update.

This topic is related to topic Good Display ePaper for Arduino

links:
https://waveshare-developmentkit.aliexpress.com/store/group/e-Paper-E-ink/216233_259057242.html
http://www.waveshare.com/wiki/1.54inch_e-Paper_Module
http://www.waveshare.com/wiki/2.13inch_e-Paper_HAT

The 1.54 and 2.13 inch Waveshare e-paper modules are also supported by my GxEPD library; they use the same e-paper displays (Dalian Good Display Inc.).

Added support for 2.9 inch e-paper display to GxEPD (GxGDEH029A1) and more.

https://github.com/ZinggJM/GxEPD




No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ZinggJM

#1
Jul 13, 2017, 09:23 am Last Edit: Jul 13, 2017, 09:25 am by ZinggJM
IoT example wiring 1.54inch e-Paper to Wemos D1 Mini:

BUSY->D6(MISO), RST->D4, DC->D3, CS->D8(SS), CLK->D5(SCK), DIN->D7(MOSI), GND->GNG, 3.3V->3.3V

SHT_SCL->D1, SHT_SDA->D2, 5V->300k->A0, D0->0.1k->RST(deep sleep wakeup)

BUSY wired to MISO to free D2 for 2-wire SHT31

2.9inch example:

BUSY->D2, RST->D4, DC->D3, CS->D8(SS), CLK->D5(SCK), DIN->D7(MOSI), GND->GND, 3.3V->3.3V
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

TeK32

This is great, thank you!

Would you care to make your code compatible with the ESP32 as well?

ZinggJM

I just got my ESP-32, so this may happen after my short holidays.
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

Helmut_number_one

#4
Jul 22, 2017, 08:41 pm Last Edit: Jul 22, 2017, 08:58 pm by Helmut_number_one
I'm user from germany, i try your scetch for 1.54 E-paper on wemos and it is running very well, but i will use a german-font.

Did you have a link to the fontgenerator so i will make a german font and perhaps graphic

Best regards, Helmut

ZinggJM

Hallo Helmut

I am also interested in German fonts, but have no experience so far. Maybe you could ask for help in the German section of the Forum. Or wait for a response from an expert.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

bogus105

Dear ZinggJM,

could you tell us more how to use 2.9inch Waveshare display with Arduino Nano/Uno. Let's leave 5V-3.3V voltage conversion issues.
I don't know pin assignments and library usage:/

I tried to figure out pinout shown in i.e. GxGDEH029A1.cpp file but it is for DESTM32-S2 connection board for STM32 system not for Arduino:/

Please put some light how to talk to WaveShare e-papers from Arduino.

One of the problems i found during compilation is that variable used to store screen resolution is uint8_t. 2.9inch screen has 296 x 128 pixels so 296 is greater that uint8_t can handle so overflow errors appeard. This is just one of the errors.

ZinggJM

Hi,

I will look at this when I am back home.
Just to be sure what you are referring to: GxEPD library or Waveshare library?

I have not yet tried to use the Waveshare library, as I use Adafruit_GFX.
But Arduino UNO has not enough RAM for full screen buffer, as used in my GxEPD.
As far as I have looked into the Waveshare code, they use a smaller (line-) buffer for text output.
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ZinggJM

Dear ZinggJM,

could you tell us more how to use 2.9inch Waveshare display with Arduino Nano/Uno. Let's leave 5V-3.3V voltage conversion issues.
I don't know pin assignments and library usage:/

I tried to figure out pinout shown in i.e. GxGDEH029A1.cpp file but it is for DESTM32-S2 connection board for STM32 system not for Arduino:/

Please put some light how to talk to WaveShare e-papers from Arduino.

One of the problems i found during compilation is that variable used to store screen resolution is uint8_t. 2.9inch screen has 296 x 128 pixels so 296 is greater that uint8_t can handle so overflow errors appeard. This is just one of the errors.
I have decided that I will look at your problems as soon as your post is more specific, more clearly stated, and more correct.

My code is generic as far as possible, with target processor specific default values for the constructor.
The DESTM32-S2 connection board is NOT STM32 specific, but its pinout matches the DESTM32-S1 STM32 demo board from Good Display.
Please state which uint8_t variable (name it!) you mean, and what other errors you refer to.
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

bogus105

Thank you ZinggJM for your answer.

You're right there was no much details in my previous post. It was rather indication:)
The only progress i made so far after playing with various libraries was when i modified Waveshare 'string' example found here:
http://www.waveshare.com/wiki/File:2.9inch_e-Paper_Module_code.7z

in arduino/string/ folder.
The following files are in this folder:
Display_Lib.h
EPD_drive.cpp
EPD_drive.h
EPD_drive_gpio.cpp
EPD_drive_gpio.h
string.ino

As you said: Nano doesn't have enough RAM for these files so i included

#include <avr/pgmspace.h>

in two files:
Display_Lib.h
EPD_drive.h

and then i changed big data tables like:

const unsigned char waveshare[4736] = {........ton of data....};

to

const unsigned char waveshare[4736] PROGMEM = {........ton of data....};

Now compilation is errorless.
Loaded things up to Nano and my progress is e-paper screen was cleared (waveshare logo that was on screen when i bought it disappeared).
No test text string was displayed.

On serial monitor i can see this:
-------------------------------------------------
------------Clear full screen-----------------
full init
***********set register Start**********
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
***********set register  end**********
send data  :
Busy is Low

full clear   

send data  :
send data  :
>>>>>>------start send display data!!---------<<<<<<<
Busy is Low

send data1
Busy is Low

full over
***********set register Start**********
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
***********set register  end**********
send data  :
Busy is Low

po operacji clear full
--------------Clear part screen------------
***********set register Start**********
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
send data  :
***********set register  end**********
send data  :
Busy is Low

>>>>>>------start send display data!!---------<<<<<<<
send data  :
send data  :
send data  :
send data  :
Busy is Low

Busy is Low

send data  :
send data  :
send data  :
send data  :
Busy is Low

po czyszczeniu czesciowym ekranu
h
FFFFFFD5 FFFFFFD5 FFFFFFD5 FFFF
---------------------------------------------------------
and so on. I seems Nano resets itself.

I wonder why BUSY line on display module is low?

The code part that checks this looks like this:

/*******************************************************************************
function:
         read busy
*******************************************************************************/
unsigned char WaveShare_EPD::ReadBusy(void)
{
  unsigned long i=0;
  for(i=0;i<400;i++){
   //   println("isEPD_BUSY = %d\r\n",isEPD_CS);
      if(isEPD_BUSY==EPD_BUSY_LEVEL) {
            Serial.println("Busy is Low \r\n");
         return 1;
      }
     driver_delay_xms(10);
  }
  return 0;
}

In for loop that you can see that during first loop execution BUSY line is compared with EPD_BUSY_LEVEL, if its true "Busy is Low" is printed and the whole ReadBusy procedure is terminated with " return 1; ".
Why this procedure returns 0 or 1 if it is not checked anywhere in the code whether 0 or 1 is returned?

Then i modified main program loop to check BUSY line status: it is LOW all the time. Maybe there is sth wrong with my module?
I checked BUSY line with multimeter and in fact it is 0 V almost all the time:/





bogus105

I'm using modified Nano board for 3.3V operation. Brief description is here:

https://forum.arduino.cc/index.php?topic=491012.0

ZinggJM

#11
Jul 25, 2017, 07:12 am Last Edit: Jul 25, 2017, 11:38 am by ZinggJM Reason: level converters
Hi bogus105

Please use code tags for code, "</>" at top left, it makes your post more pleasant to read.

You do not provide any info concerning errors, so I forget about those.

When you put data into PROGMEM, you need to read it with the corresponding read function; there are tutorials about this.

The BUSY line is active when the controller takes time for commands, e.g. on update to display.

I have not yet tried to use the Waveshare code; I may do this, but not with UNO or NANO to avoid the need for level converters or series resistors.

Jean-Marc

I may reconsider to try with UNO and NANO, as I just received level converters that I want to use anyway:

https://www.aliexpress.com/item/8-channel-level-conversion-module-two-way-conversion-between-3-3V-and-5V-IO-access-5V/32811827434.html

I think any Arduino UNO or NANO user should have some of those ready at hand, or some other make.
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ZinggJM

#12
Jul 25, 2017, 02:42 pm Last Edit: Jul 25, 2017, 02:44 pm by ZinggJM
This is great, thank you!

Would you care to make your code compatible with the ESP32 as well?
Yes, I did. I have updated GxEPD on GitHub.

No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ZinggJM

Thank you ZinggJM for your answer.

You're right there was no much details in my previous post. It was rather indication:)
The only progress i made so far after playing with various libraries was when i modified Waveshare 'string' example found here:
http://www.waveshare.com/wiki/File:2.9inch_e-Paper_Module_code.7z

in arduino/string/ folder.
The following files are in this folder:
Display_Lib.h
EPD_drive.cpp
EPD_drive.h
EPD_drive_gpio.cpp
EPD_drive_gpio.h
string.ino

As you said: Nano doesn't have enough RAM for these files so i included

#include <avr/pgmspace.h>

in two files:
Display_Lib.h
EPD_drive.h

and then i changed big data tables like:

const unsigned char waveshare[4736] = {........ton of data....};

to

const unsigned char waveshare[4736] PROGMEM = {........ton of data....};

Now compilation is errorless.
Loaded things up to Nano and my progress is e-paper screen was cleared (waveshare logo that was on screen when i bought it disappeared).
No test text string was displayed.
...
I could compile the Waveshare string example successfully for Arduino UNO and NANO.

The waveshare array is referenced nowhere in the code, and therefore not included in the link process, at least with the actual Arduino IDE 1.8.3.

Do you use an older version of Arduino, or have you done other changes to the code?

I would just ignore your posts, but try to answer, so other users interested in these displays do not become insecure.
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

jpg63

Hello
I would like to use the "waveshare" 1.54 inch screen with an arduino MKR Zero, do you think this is possible?
Are the changes to be made to your library important?

Go Up