Go Down

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

bartek10226

Ok, i tried with arduino nano. Today i tried to just display demo code from waveshare.wiki. I have this 1.54inch display:
https://www.waveshare.com/wiki/1.54inch_e-Paper_Module_(B)

I use this nano:



As i read in instruction in datasheet, i've connected pins in this order:

RST_PIN       18
DC_PIN         17
CS_PIN         10
BUSY_PIN     19

And others:
CLK              16
DIN              14

I have edited source code (epdif.h) macros because this in datasheet was for uno:
#define RST_PIN         18
#define DC_PIN          17
#define CS_PIN          10
#define BUSY_PIN        19

I uploaded this demo code with changes i mentioned before:
https://www.waveshare.com/wiki/File:1.54inch_e-paper_module_b_code.7z

As they said in datasheet it should look like this:
Quote
EXPECTED RESULT
1) e-Paper is refreshed to white
2) Display a picture
3) Draw circles and lines, text is displayed
4) Display times. (partial refresh)
One of my epapers after uploading this code, half of it was red other in white. Second of my papers didnt even react. I dont use nothing more than this nano and board with epaper, because as i saw in official videos it isnt required to have ESP or something other. I was looking for where is macro definition for CLK and DIN but i didnt found.

ZinggJM

Ok, now I know what you use. I don't have the Waveshare demo code at hand, so I will answer more tomorrow. I don't know if they use HW SPI.

DIN should be connected to MOSI, pin 11 on your picture. CLK to SCK, pin 13, for HW SPI.

Good luck!
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.

bartek10226

#1532
Oct 09, 2019, 09:09 pm Last Edit: Oct 10, 2019, 01:04 am by bartek10226
Thank you for your reply, i will wait because connections seems to be good.
Now i tried to use your library to test if my communication is working. In GxEpd_example from your github i uncomment #include "GxGDEP015OC1/GxGDEP015OC1.h"    // 1.54" b/w
and wrote into this line(starting with #elif defined(ARDUINO_ARCH_SAMD)

GxIO_Class io(SPI, /*CS=*/ 10, /*DC=*/ 8, /*RST=*/ 9);
GxEPD_Class display(io, /*RST=*/ 9, /*BUSY=*/ 7);

Others lines i left by default. And i have a problem because when i try to compile:
exit status 1
GxGDEP015OC1/BitmapExamples.h: No such file or directory

youcancallmebear

hi everyone, I am trying to play with GxEPD, but I do not know how to a partial update
ok, things like this.
I draw all the interface by myself, such as I draw the bitmap and draw the line then I use display.update
and I set up the update window, and I use display.updateWindow(box_x, box_y, box_w, box_h, true) but things not correct like what I am thinking


the example shows first we draw a background pic then we do a partial update

my question is when I did not just draw a bitmap, what is the right way to do the partial update?

ZinggJM

#1534
Oct 10, 2019, 08:33 am Last Edit: Oct 10, 2019, 08:47 am by ZinggJM
@bartek10226,

your Arduino Nano uses an Atmel MEGA328P aka Atmega328 processor, same as Arduino UNO.

Arduino IDE uses the same pins for HW SPI as for Arduino UNO (no special variant):

C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.1\variants\standard\pins_arduino.h

Code: [Select]
#define PIN_SPI_SS    (10)
#define PIN_SPI_MOSI  (11)
#define PIN_SPI_MISO  (12)
#define PIN_SPI_SCK   (13)

static const uint8_t SS   = PIN_SPI_SS;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK  = PIN_SPI_SCK;


The Waveshare demo code you use also uses HW SPI. You can use the same wiring and definitions as for Arduino UNO, epdif.h:

Code: [Select]
// Pin definition
#define RST_PIN         8
#define DC_PIN          9
#define CS_PIN          10
#define BUSY_PIN        7


If you change the definitions, you must make sure to use the connections accordingly.

Quote
One of my epapers after uploading this code, half of it was red other in white. Second of my papers didnt even react.
This rather looks like a HW connection issue. Make sure the white connector is firmly pushed in.
Make sure the DuPont connectors are ok and make good contact; I had a cable with a DuPont connector that didn't make contact, isolation not removed.

Quote
and wrote into this line(starting with #elif defined(ARDUINO_ARCH_SAMD)
Wrong place. Use GxEPD2 instead of GxEPD, this is easier for Newbies.

And wrong e-paper selected b/w.

Install the library GxEPD2 using Library Manager directly, not with download and zip-install.
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

@youcancallmebear,

with GxEPD you need to do a full update before any partial update, for e-papers that support "fast partial update" (differential update). This can be a background bitmap, a white screen, or whatever you like.

I recommend to use GxEPD2 for Newbies or new projects.

GxEPD2 will do an automatic full update as first update, when needed.

Please always report processor used and e-paper used when asking a question.
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.

bartek10226

ZinggJM, thank you very much i get it now, it is working using your best library!

MarkusBeubl

Hello together,

I'm using MKR GSM1400 with Waveshare 1.54  B/W and GxEPD2,

I set the pins to:
BUSY -> 5, RST -> 6, DC -> 7, CS-> 4, CLK -> 9, DIN -> 8


Uncommand this line in boards_added:
GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5));


The display do nothing and the serial monitor says
14:59:44.580 -> Busy Timeout!
14:59:44.580 -> _PowerOff : 10000402

Does anyone have an idea what i forgot?

ZinggJM

Hi Markus,

I don't see anything wrong. And I checked variant.h for mkrgsm1400 for SPI pins.

You could check the version of the Waveshare board. Does it have the level converter, a square smd chip?

If so, try if it works with VCC connected to 5V. For longer use you should then use a series resistor on the BUSY line to protect the processor from 5V from the level converter.

Also check if the connector is firmly pushed in on the board, and all DuPont pin connectors are ok.

BUSY timeout usually means the display controller doesn't receive the commands from SPI.

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.

vonodna

When using the library with Waveshare 640x384 Three-Color 7.5" display I get everything I write with println on the screen repeated, more specifically the upper half of the screen is repeated on the lower half. This also happens with the example file GxEPD_Example.
The header I left is this one:
Code: [Select]
#include <GxGDEW075Z09/GxGDEW075Z09.h>    // 7.5" b/w/r

Any help will be appreciated.

ZinggJM

Hi vonodna,

You should provide more information, e.g. processor used. But I know you use ESP8266, because this processor doesn't have enough RAM to buffer the image of the whole screen for 3-color.

Maybe this is in README.MD? I'm not sure.

You need paged drawing to avoid this.

Or you could use GxEPD2, where paged drawing is used per default.

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.

AlexBZH

Hi,

For those of you who are using Wemos D1 Mini with ePaper and a GPS module, and wonder why the ePaper stops displaying after the first GPS call, and randomly reboots, just add a yield() in the GPS section.

I don't really know why, but it solved all my problems at once :D

Code: [Select]
  do
  {
    while (ssGPS.available())
      gps.encode(ssGPS.read());
      yield();
  } while (millis() - start < ms);



BTW I am using GxEPD2.

Alex

vonodna

Yes, I use NodeMCU based  ESP 8266. It has 128kBytes of memory. With the Paged example (PagedDisplayForSmallRam) the bitmaps work OK, but the font test is wrongly displayed.


In README.md is written:

"ESP8266, ESP32 , STM32 systems, Arduino Due e.g. have enough free RAM for full graphics buffer."

ZinggJM

Ok, I will fix this sentence with "except for 7.5" 3-color e-paper".
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.

Formdestroyer

I am currently trying to reduce the power consumption of my ESP32 (Sparkfun ESP32 Thing) in deep sleep.

Initially I started with the Waveshare ESP board, but deep sleep consumption was very high, so I switched over to the Sparkfun ESP. After cutting the traces of the LED & Flash I now manage to get power consumption down to 55 µA in deep sleep. This is measured between the onboard battery connector and some standard li-ion battery. I am quite happy with that :)

When connecting the Waveshare E-Paper-HAT 1,21 mA are needed in deep sleep (22 times as much!!!).

I read somewhere in this thread, that there are different HAT versions available, but i cannot really find different schematics or information abouth that. Also I have read that with 7.5" displays (and I am using those...) powering through the 3.3V won't work reliable. I haven't experienced any issues yet, is that because of the HATs logic converter?

So far I have not measured the total power consumption of the HAT with the connected display, how much does it draw max when updating the display? I know it is not the ideal way to power the display through an esp32 gpio, but the display draws less than 12mA I could power the display through a GPIO directly, without any addition transistor or such, right?

Is there anything on the software side I can do? Currently I am only calling a display.poweroff before going to deep sleep, anything else I can try?


Go Up