Go Down

Topic: Waveshare e-paper displays with SPI (Read 209877 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!

Go Up