Adafruit is open and shipping! Let's build back better, together!
0

eInk 2.9" display not working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

eInk 2.9" display not working

by anven on Tue Nov 10, 2020 1:27 pm

Hi, I am having a problem getting the adafruit 2.9" Flexible eInk display working with the Arduino library-
I am trying the EPD example with a 2.9" flexible monochrome... but getting a terminal error "buf not large enough"... any advice?

Tracing through the code, the buffer size is set to 64 in EPD_CommandList function, but num_args parameter that is compared returns 200... I cannot determine where that value comes from.


Using the E-Ink friend with Metro Mini.

Output:
Adafruit EPD test
set pins
hard reset
busy
done!
Command: 0x50
Data: 0x17,
Command: 0x82
Data:
Command: 0x2
Powering Up
Command: 0x1
Data: 0x3, 0x0, 0x2B, 0x2B, 0x9,
Command: 0x6
Data: 0x17, 0x17, 0x17,
Command: 0x4
Data:
ERROR - buf not large enough!

eink.jpg
eink.jpg (124.91 KiB) Viewed 131 times

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 10, 2020 1:42 pm

Are you commenting / uncommenting the correct lines of code for that EPD? Including the #define. For that EPD, I think you want these lines:
Code: Select all | TOGGLE FULL SIZE
/* Uncomment the following line if you are using 2.9" EPD */
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
//#define FLEXIBLE_290

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Re: eInk 2.9" display not working

by anven on Tue Nov 10, 2020 1:49 pm

Yes:

Code: Select all | TOGGLE FULL SIZE
/* Uncomment the following line if you are using 2.9" EPD */
Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
#define FLEXIBLE_290



Also pins are defined as follows:

Code: Select all | TOGGLE FULL SIZE
#define EPD_CS     10
#define EPD_DC      9
#define SRAM_CS     8
#define EPD_RESET   5 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY    3 // can set to -1 to not use a pin (will wait a fixed delay)

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by anven on Tue Nov 10, 2020 1:53 pm

I also get alo of REDEFINED warnings during compile... not sure if related:

In file included from xxx\Documents\Arduino\libraries\Adafruit_EPD\src/Adafruit_EPD.h:179:0,
from C:\Users\xxxAppData\Local\Temp\arduino_modified_sketch_647898\EPDTest.ino:10:
xxx\Documents\Arduino\libraries\Adafruit_EPD\src/drivers/Adafruit_IL0398.h:7:0: warning: "EPD_RAM_BW" redefined
#define EPD_RAM_BW 0x10

In file included from xxx\Documents\Arduino\libraries\Adafruit_EPD\src/Adafruit_EPD.h:178:0,
from C:\Users\xxx\AppData\Local\Temp\arduino_modified_sketch_647898\EPDTest.ino:10:
xxxx\Arduino\libraries\Adafruit_EPD\src/drivers/Adafruit_IL0373.h:35:0: note: this is the location of the previous definition
#define EPD_RAM_BW IL0373_DTM1

In file included from xxx\Documents\Arduino\libraries\Adafruit_EPD\src/Adafruit_EPD.h:179:0,
from C:\Users\xxx\AppData\Local\Temp\arduino_modified_sketch_647898\EPDTest.ino:10:
xxx\Documents\Arduino\libraries\Adafruit_EPD\src/drivers/Adafruit_IL0398.h:8:0: warning: "EPD_RAM_RED" redefined
#define EPD_RAM_RED 0x13

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 10, 2020 2:41 pm

Try changing your setup() to the code below. This adds some extra serial prints to help see where / what is making the bad call.
Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(115200);
  //while (!Serial) { delay(10); }
  Serial.println("Adafruit EPD test");
 
  display.begin();

  Serial.println("Flexible config");
#if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
  // The flexible displays have different buffers and invert settings!
  display.setBlackBuffer(1, false);
  display.setColorBuffer(1, false);
#endif

  // large block of text
  Serial.println("Text - Buffer clear");
  display.clearBuffer();
  testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", COLOR1);
  Serial.println("Text - Refresh display");
  display.display();

  delay(5000);

  Serial.println("Lines - Buffer clear");
  display.clearBuffer();
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, COLOR1);
  }

  for (int16_t i=0; i<display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, COLOR2);  // on grayscale this will be mid-gray
  }
  display.display();
}

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Re: eInk 2.9" display not working

by anven on Tue Nov 10, 2020 2:51 pm

Here is the terminal output with new setup():

Adafruit EPD test
set pins
hard reset
busy
done!
Command: 0x50
Data: 0x17,
Command: 0x82
Data:
Command: 0x2
Flexible config
Text - Buffer clear
Text - Refresh display
Powering Up
Command: 0x1
Data: 0x3, 0x0, 0x2B, 0x2B, 0x9,
Command: 0x6
Data: 0x17, 0x17, 0x17,
Command: 0x4
Data:
ERROR - buf not large enough!

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 10, 2020 5:08 pm

Thanks. That helped narrow it done. Issue opened here:
https://github.com/adafruit/Adafruit_EPD/issues/32

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 10, 2020 5:55 pm

Saw your post in the issue thread.

Can you check your connection on the busy pin. Maybe it's now getting stuck in the busy wait loop here?
https://github.com/adafruit/Adafruit_EP ... 73.cpp#L97

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Re: eInk 2.9" display not working

by anven on Tue Nov 10, 2020 6:15 pm

I set the busy pin assignment to -1 and got alot farther along. Still no change to the display though:

Adafruit EPD test
set pins
hard reset
busy
done!
Command: 0x50
Data: 0x17,
Command: 0x82
Data:
Command: 0x2
Flexible config
Text - Buffer clear
Text - Refresh display
Powering Up
Command: 0x1
Data: 0x3, 0x0, 0x2B, 0x2B, 0x9,
Command: 0x6
Data: 0x17, 0x17, 0x17,
Command: 0x4
Data:
Waiting...OK!
Command: 0x0
Data: 0xCF,
Command: 0x50
Data: 0x37,
Command: 0x30
Data: 0x29,
Command: 0x82
Data: 0xA,
Waiting...OK!
Command: 0x61
Data: 0x80, 0x1, 0x28,
Set RAM address
Command: 0x10
Command: 0x13
Update
Command: 0x12
Waiting...OK!
Lines - Buffer clear
Powering Up
Command: 0x1
Data: 0x3, 0x0, 0x2B, 0x2B, 0x9,
Command: 0x6
Data: 0x17, 0x17, 0x17,
Command: 0x4
Data:
Waiting...OK!
Command: 0x0
Data: 0xCF,
Command: 0x50
Data: 0x37,
Command: 0x30
Data: 0x29,
Command: 0x82
Data: 0xA,
Waiting...OK!
Command: 0x61
Data: 0x80, 0x1, 0x28,
Set RAM address
Command: 0x10
Command: 0x13
Update
Command: 0x12
Waiting...OK!

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by anven on Tue Nov 10, 2020 6:21 pm

Busy pin is always low. I dont see any activity. Confirmed good activity on the SPI and D/C pins.

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 10, 2020 6:57 pm

Can you post some more photos of your setup more zoomed in on the soldering and connections. And show both sides of the setup.

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Re: eInk 2.9" display not working

by anven on Tue Nov 10, 2020 7:20 pm

Its hard to see in the photo, but the pinout is as follows:
SCK - 13
MISO - 12
MOSI - 11
ECS - 10
D/C - 9
SRCS - 8
SDCS - N/C
RST - 5
BUSY - 3
ENA - N/C

IMG_0761[2].jpg
IMG_0761[2].jpg (413.48 KiB) Viewed 112 times
IMG_0762[2].jpg
IMG_0762[2].jpg (465.45 KiB) Viewed 112 times


I double checked the soldering and as I mentioned, I see the SPI signals on the E-Ink Friend board.
Do you have access to the datasheet for the display?

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by anven on Mon Nov 16, 2020 10:22 am

@adafruit_support_carter - any chance you can provide the datasheet for the panel/controller? I am still not able to operate it.

anven
 
Posts: 10
Joined: Mon Nov 09, 2020 5:50 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 17, 2020 4:48 pm

I've set this up and recreated the issue in your first post. I also tested with an Itsy Bitsy M4, and it worked fine. So it's something unique to the Metro Mini.

Will respond back after some investigating.

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Re: eInk 2.9" display not working

by adafruit_support_carter on Tue Nov 17, 2020 8:47 pm

Check all of your connections. The variable type change was the only thing I needed to do to get it to work.

Here's the sketch. Target board was set to Arduino Uno.
Code: Select all | TOGGLE FULL SIZE
/***************************************************
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.
  MIT license, all text above must be included in any redistribution
 ****************************************************/

#include "Adafruit_EPD.h"


#define EPD_CS     10
#define EPD_DC     9
#define SRAM_CS    8 // 10
#define EPD_RESET  5 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY   3  // can set to -1 to not use a pin (will wait a fixed delay)

/* Uncomment the following line if you are using 1.54" tricolor EPD */
//Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

/* Uncomment the following line if you are using 1.54" monochrome EPD */
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

/* Uncomment the following line if you are using 2.13" tricolor EPD */
//Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
//#define FLEXIBLE_213

/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);

/* Uncomment the following line if you are using 2.9" EPD */
Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
#define FLEXIBLE_290

/* Uncomment the following line if you are using 4.2" tricolor EPD */
//Adafruit_IL0398 display(300, 400, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);


#define COLOR1 EPD_BLACK
#define COLOR2 EPD_RED


void setup() {
  Serial.begin(115200);
  while (!Serial) { delay(10); }
  Serial.println("Adafruit EPD test");
 
  display.begin();

#if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
  // The flexible displays have different buffers and invert settings!
  display.setBlackBuffer(1, false);
  display.setColorBuffer(1, false);
#endif

  // large block of text
  Serial.println("large block of test");
  display.clearBuffer();
  testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", COLOR1);
  display.display();

  delay(5000);

  Serial.println("draw lines COLOR1");
  display.clearBuffer();
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, COLOR1);
  }

  Serial.println("draw lines COLOR2");
  for (int16_t i=0; i<display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, COLOR2);  // on grayscale this will be mid-gray
  }
  display.display();
}

void loop() {
  //don't do anything!
}


void testdrawtext(char *text, uint16_t color) {
  display.setCursor(0, 0);
  display.setTextColor(color);
  display.setTextWrap(true);
  display.print(text);
}


Here's the Serial Monitor output:
Code: Select all | TOGGLE FULL SIZE
Adafruit EPD test
set pins
hard reset
busy
done!
   Command: 0x50
   Data: 0x17,
   Command: 0x82
   Data:
   Command: 0x2
large block of test
  Powering Up
   Command: 0x1
   Data: 0x3, 0x0, 0x2B, 0x2B, 0x9,
   Command: 0x6
   Data: 0x17, 0x17, 0x17,
   Command: 0x4
   Data:
Waiting...OK!
   Command: 0x0
   Data: 0xCF,
   Command: 0x50
   Data: 0x37,
   Command: 0x30
   Data: 0x29,
   Command: 0x82
   Data: 0xA,
Waiting...OK!
   Command: 0x61
   Data: 0x80, 0x1, 0x28,
  Set RAM address
   Command: 0x10
   Command: 0x13
  Update
   Command: 0x12
Waiting...OK!
draw lines COLOR1
draw lines COLOR2
  Powering Up
   Command: 0x1
   Data: 0x3, 0x0, 0x2B, 0x2B, 0x9,
   Command: 0x6
   Data: 0x17, 0x17, 0x17,
   Command: 0x4
   Data:
Waiting...OK!
   Command: 0x0
   Data: 0xCF,
   Command: 0x50
   Data: 0x37,
   Command: 0x30
   Data: 0x29,
   Command: 0x82
   Data: 0xA,
Waiting...OK!
   Command: 0x61
   Data: 0x80, 0x1, 0x28,
  Set RAM address
   Command: 0x10
   Command: 0x13
  Update
   Command: 0x12
Waiting...OK!


Here's the setup. I got all of the expected output on the EPD.
metro_mini_epd.jpg
metro_mini_epd.jpg (261.1 KiB) Viewed 57 times

adafruit_support_carter
 
Posts: 17777
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.


cron