Go Down

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

nenne910

Hello I'am trining to connect my waveshare 7.5 Epaper display.

I'am using the Adafruit ESP32 Feather 2019




I have tried to connect it with SPI interface through



I don't get it to work with the wiring.


The screen never change and it print out "Screen Bussy"

Anyone can help me with the right wiring?

play113

#1306
May 17, 2019, 02:08 pm Last Edit: May 17, 2019, 02:12 pm by play113
hi @all,

sorry for my beginner question ....

i user the waveshare esp32 driver boar with an 2.9B display




i don't get a reaction from the display with my code

thanks for possible help or a tip

Code: [Select]


#include <GxEPD.h>
#include <GxGDEH029A1/GxGDEH029A1.cpp> // 2.9" b/w
#include <GxIO/GxIO_SPI/GxIO_SPI.cpp>
#include <GxIO/GxIO.cpp>
#include <Fonts/FreeSansBold24pt7b.h>

// from waveshare user manual
// PIN_SPI_SCK  13
// PIN_SPI_DIN  14
// PIN_SPI_CS   15
// PIN_SPI_BUSY 25/19
// PIN_SPI_RST  26/21
// PIN_SPI_DC   27/22
// GxIO_Class io(SPI, CS, DC, RST);
// GxEPD_Class display(io, RST, BUSY);
GxIO_Class  io(SPI, 15, 27, 26);
GxEPD_Class display(io, 26, 25);

const char* name = "FreeSansBold24pt7b";
const GFXfont* f = &FreeSansBold24pt7b;

void setup() {
  Serial.begin(9600);
  delay(3000);
  Serial.println("Starting...");
  display.init();
  display.setRotation(1);
  display.fillScreen(GxEPD_WHITE);
  display.update();
  display.setTextColor(GxEPD_BLACK);
  display.setFont(f);
  display.setCursor(5, 5);
  display.println();
  display.println(" Hello");
  display.update();
  delay(6000);
  display.setRotation(0);
}

void loop() {
  Serial.println(millis());
  delay(10000);  
}

ZinggJM

@play113

The Waveshare ESP32 doesn't use the standard SPI pins. This works with SW SPI with the Waveshare demo. But GxEPD and GxEPD2 use only HW SPI.

With ESP32 HW SPI can be re-mapped to different IO pins. There is an example for GxEPD2: GxEPD2_WS_ESP32_Driver.

I propose you start with this example. The same method should also work with GxEPD, but I have not tried.
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.

aaamorano

thanks a lot for help the display works
I did not see the right track on my own

play113

@ZinggJM

Thanks for the note, I'll take a look right now.

play113

i'm being stupid ...

the GxEPD2-example dosn't work ;(

Code: [Select]

#define ENABLE_GxEPD2_GFX 0

#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include <Fonts/FreeMonoBold9pt7b.h>

GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(/*CS=*/ 15, /*DC=*/ 27, /*RST=*/ 26, /*BUSY=*/ 25));

void setup() {
  Serial.begin(115200);
  delay(500);
  Serial.println();
  Serial.println("Setup ...");
  display.init(115200); // uses standard SPI pins, e.g. SCK(18), MISO(19), MOSI(23), SS(5)
  // *** special handling for Waveshare ESP32 Driver board *** //
  // ********************************************************* //
  SPI.end(); // release standard SPI pins, e.g. SCK(18), MISO(19), MOSI(23), SS(5)
  //SPI: void begin(int8_t sck=-1, int8_t miso=-1, int8_t mosi=-1, int8_t ss=-1);
  SPI.begin(13, 12, 14, 15); // map and init SPI pins SCK(13), MISO(12), MOSI(14), SS(15)
  // *** end of special handling for Waveshare ESP32 Driver board *** //
  // **************************************************************** //
  // first update should be full refresh
  Serial.println("HelloWorld");
  display.setFont(&FreeMonoBold9pt7b);
  display.fillScreen(GxEPD_WHITE);
  display.setTextColor(GxEPD_BLACK);
  display.println("HelloWorld");
  delay(1000);
  Serial.println("setup done");
}




@aaamorano

you got a working piece of code ?

ZinggJM

#1311
May 17, 2019, 09:06 pm Last Edit: May 17, 2019, 09:07 pm by ZinggJM
Maybe it is just display.display(); missing, to update the screen.

Why didn't you use the complete example?
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.

play113

#1312
May 17, 2019, 09:16 pm Last Edit: May 17, 2019, 10:02 pm by play113
the full example doesn't work either ;(

Code: [Select]

st:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:9232
load:0x40080400,len:6400
entry 0x400806a8

Busy Timeout!
_PowerOn : 10001018
Busy Timeout!
_Update_Full : 10001015
Busy Timeout!
_PowerOff : 10001015



play113

#1313
May 17, 2019, 10:11 pm Last Edit: May 17, 2019, 10:11 pm by play113
ok ... this display

is a 3 color version, i change to

Code: [Select]

GxEPD2_3C<GxEPD2_290c, GxEPD2_290c::HEIGHT> display(GxEPD2_290c(/*CS=*/ 15, /*DC=*/ 27, /*RST=*/ 26, /*BUSY=*/ 25));


and works now ...

sorry for the confusion.

strange_v

Hi.
I'm going to use 1.54" 200x200 display in a wearable. To save place I'll use bare display and a custom circuit for it. The schematic for the display is quite simple, however, I don't like the size of some components.

MBR0530 Schottky diode, it rated 0.5A 30V, it huge and I need 3 of them. I would like to use something like BAT54VV (Schottky barrier triple diode in ultra small SOT666 package) they rated 0.2A 30V.
Will this be enough?

Probably the same case with Si1308EDL MOSFET 1.5A 30V.

aaamorano

Yes, you made a mistake. You don't tell any details.

With GxEPD2 this error occurs, if you don't select your e-paper display in the conditional compile section for your processor.

As your processor is a MEGA, which is an AVR processor, you select it after

#if defined(__AVR)

This is the line for your display, assuming it is 4.2" b/w:

GxEPD2_BW<GxEPD2_420, MAX_HEIGHT(GxEPD2_420)> display(GxEPD2_420(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));

BTW: select means uncomment the line :)

Note that I may become too lazy to answer your lazy posts, having to guess what you try.

Please also read How to use this forum - please read.

after your guidance in the code I have try to put bitmaps but I have not done the steps that I have I think that's right

1.I have remove it from comment
the line #include "bitmaps/Bitmaps400x300.h" // 4.2"  b/w // not enough code space

Code: [Select]

#else
// select only one to fit in code space
///#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/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


2.I only keep the line that speaks for my screen because if I leave it the memory is overloaded

Code: [Select]

void drawBitmaps()
{
  display.setFullWindow();
  #ifdef _GxBitmaps3c400x300_H_
  drawBitmaps3c400x300();
#endif

/* 
#ifdef _GxBitmaps104x212_H_
  drawBitmaps104x212();
#endif
#ifdef _GxBitmaps128x250_H_
  drawBitmaps128x250();
#endif
#ifdef _GxBitmaps128x296_H_
  drawBitmaps128x296();
#endif
#ifdef _GxBitmaps176x264_H_
  drawBitmaps176x264();
#endif
#ifdef _GxBitmaps400x300_H_
  drawBitmaps400x300();
#endif
#ifdef _GxBitmaps640x384_H_
  drawBitmaps640x384();
#endif
#ifdef _WS_Bitmaps800x600_H_
  drawBitmaps800x600();
#endif
  // 3-color
#ifdef _GxBitmaps3c104x212_H_
  drawBitmaps3c104x212();
#endif
#ifdef _GxBitmaps3c128x296_H_
  drawBitmaps3c128x296();
#endif
#ifdef _GxBitmaps3c176x264_H_
  drawBitmaps3c176x264();
#endif


3.and I put the file bitmaps (the file is much larger is not a line) the program I used is the Img2Lcd and the archive is in the form C array (*.c)

Code: [Select]

#ifdef _GxBitmaps400x300_H_
void drawBitmaps400x300()
{
#if !defined(__AVR)
   const unsigned char* bitmaps[] =
  {
    Bitmap400x300_1, Bitmap400x300_2
  };
#else
  const unsigned char* bitmaps[] = {
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,
}; // not enough code space

#endif

  if (display.epd2.panel == GxEPD2::GDEW042T2)
  {
    for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
    {
      display.firstPage();
      do
      {
        display.fillScreen(GxEPD_WHITE);
        display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
      }
      while (display.nextPage());
      delay(2000);
    }
  }
}
#endif


I believe there is something that has escaped me but I have not seen it yet

ZinggJM

#1316
May 20, 2019, 08:37 am Last Edit: May 20, 2019, 03:36 pm by ZinggJM
@aaamorano,

I do not like, if I have to look through a posters previous posts to find out what e-paper and processor board he has.

In your case, I still do not know if you have a 4.2" b/w or a 4.2" 3-color display.

I can't help, if you don't clearly state what you want to do.

With GxEPD2_Example you should get output on your display, if you select (uncomment) the correct constructor line for your display. Report if you got GxEPD2_Example working, before asking for help on anything else. You should see smaller bitmaps presented on the display. The 4.2" full-screen bitmap does not would fit into code space of your Atmega2560 processor.

Always report the exact e-paper and processor board used, and library used in every post, unless this information is available in the directly preceding post.

const unsigned char* bitmaps[] =

expects an array (list) of pointers to bitmaps.

const unsigned char* bitmaps[] = {
0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,

is not an array of pointers to bitmaps.

Note that the method drawInvertedBitmap() is for example bitmaps and expects the bitmap data in PROGMEM.

The Adafruit_GFX method drawBitmap() can take bitmap data from RAM or PROGMEM, by signature matching. You can use it with inverted bitmaps by specifying foreground and background color.
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.

aaamorano

ZinggJM

I have a 4.2 "b / w screen

the link is the one you told me before

the GxEPD2_Example operation normally

in general terms what I want to do is connect the monitor to the Arduino Mega and file archive bitmaps

if you need any information please let me know

ZinggJM

@aaamorano, thanks, I don't need anything from you.
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.

Guifox

Hello everyone, i have some questions.

I have 6 e-ink screens 2,13 (D) and i need to display 1 different image for each screen.
What can you advise for driving them?

If i use SPI, I think i need 6 CS pins for displays + 6 CS pins for SRAM + 1 CS pin for the SD.
but i dont how configurate the PIN SRAM on my E-paper Shield.

Is it easier to use the SPI or I2C protocol to control 6 e-papers?

Thx in advance.


Go Up