0

EPD Library for Arduino
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

EPD Library for Arduino

by mamcgu on Sun Apr 25, 2021 1:14 am

I tried using the 2.13" E Paper display with what looks like the 4.4.0 library, with no luck. This is using an original UNO, with the demo code. Arduino IDE 1.8.5.

Per the diagram on https://learn.adafruit.com/adafruit-2-1 ... ngs/wiring :
Pin 11 --> MOSI
Pin 12 -- MISO
Pin 13 --> SCK

The library has:

#define EPD_CS 10
#define EPD_DC 9
#define SRAM_CS 8
#define EPD_RESET 5
#define EPD_BUSY 3

The diagram has:
Busy --> Pin 7
RST --> Pin 8
SDCS --> Pin 5
SRCS --> Pin 6
D/C -- Pin 10
ECS --> Pin 9

I tried several ways to untangle this, with no luck. If you can point me to the correct Arduino hookup diagram I would appreciate it.
Thanks
Mark

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Mon Apr 26, 2021 12:42 pm

Let's make sure it's not some other hardware issue. Please post a photo of your setup showing how everything is connected.

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

Re: EPD Library for Arduino

by mamcgu on Tue Apr 27, 2021 1:31 am

The point I was trying (and obviously failed) to make was: I don't know the right way to hook this thing up. If you look carefully at the #define commands, they contradict the wiring diagram for Arduino. If someone could point me to the authoritative hookup directions, I might have more success with this.
Mark

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Tue Apr 27, 2021 10:46 am

What you link in your first post should work. But not sure if you're following that or doing something different? You link to it but then mention different pins.

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

Re: EPD Library for Arduino

by mamcgu on Tue Apr 27, 2021 5:32 pm

My first post has this:

The library has:
#define EPD_CS 10
#define EPD_DC 9
#define SRAM_CS 8
#define EPD_RESET 5
#define EPD_BUSY 3

The diagram has:
Busy --> Pin 7
RST --> Pin 8
SDCS --> Pin 5
SRCS --> Pin 6
D/C -- Pin 10
ECS --> Pin 9

OK, Busy is either pin 7 or pin 3. Which? D/C is either pin 10 or pin 9. Which is it? CS is either pin 6 or pin 10 --?? Reset--pin 8 or pin 5 ?
Also I assume SDCS has to do with the SD card. So is SRCS the same as EPD_CS? Or is it ECS? Is D/C equivalent to EPD_DC?

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Wed Apr 28, 2021 10:42 am

Sorry, meant for the main SPI pins.
Per the diagram on https://learn.adafruit.com/adafruit-2-1 ... ngs/wiring :
Pin 11 --> MOSI
Pin 12 -- MISO
Pin 13 --> SCK

The diagrams have you attach SPI pins to the ICSP header.

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

Re: EPD Library for Arduino

by mamcgu on Wed Apr 28, 2021 5:26 pm

I give up.

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Wed Apr 28, 2021 7:00 pm

Ah, for the UNO, those happen to be the same. The Metro is different, which is why it uses the ISCP header.

I just ran the library example on an UNO and it worked OK.
https://github.com/adafruit/Adafruit_EP ... nkInk_mono

Using your pins for SPI:
Pin 11 --> MOSI
Pin 12 -- MISO
Pin 13 --> SCK

And the rest as per the guide/sketch. Here's the exact sketch I ran:

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_ThinkInk.h"

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

// 1.54" Monochrome displays with 200x200 pixels and SSD1681 chipset
//ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 1.54" Monochrome displays with 200x200 pixels and SSD1608 chipset
//ThinkInk_154_Mono_D27 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 1.54" Monochrome displays with 152x152 pixels and UC8151D chipset
//ThinkInk_154_Mono_M10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 2.13" Monochrome displays with 250x122 pixels and SSD1675 chipset
ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 2.13" Monochrome displays with 250x122 pixels and SSD1675B chipset
//ThinkInk_213_Mono_B73 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 2.13" Monochrome displays with 250x122 pixels and SSD1680 chipset
//ThinkInk_213_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
//ThinkInk_213_Mono_B74 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 2.13" Monochrome displays with 212x104 pixels and UC8151D chipset
//ThinkInk_213_Mono_M21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);


// 2.9" 4-level Grayscale (use mono) displays with 296x128 pixels and IL0373 chipset
//ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 2.9" Monochrome displays with 296x128 pixels and UC8151D chipset
//ThinkInk_290_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);


// 4.2" Monochrome displays with 400x300 pixels and SSD1619 chipset
//ThinkInk_420_Mono_BN display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 4.2" Monochrome displays with 400x300 pixels and UC8276 chipset
//ThinkInk_420_Mono_M06 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);


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

void loop() {
  Serial.println("Banner demo");
  display.clearBuffer();
  display.setTextSize(3);
  display.setCursor((display.width() - 180)/2, (display.height() - 24)/2);
  display.setTextColor(EPD_BLACK);
  display.print("Monochrome");
  display.display();

  delay(2000);
 
  Serial.println("B/W rectangle demo");
  display.clearBuffer();
  display.fillRect(display.width()/2, 0, display.width()/2, display.height(), EPD_BLACK);
  display.display();

  delay(2000);
 
  Serial.println("Text demo");
  // large block of text
  display.clearBuffer();
  display.setTextSize(1);
  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. ", EPD_BLACK);
  display.display();

  delay(2000);

  display.clearBuffer();
  for (int16_t i=0; i<display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, EPD_BLACK);
  }

  for (int16_t i=0; i<display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, EPD_BLACK);
  }
  display.display();

  delay(2000); 
}


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


Here's the setup:
uno_epd_test.jpg
uno_epd_test.jpg (216.98 KiB) Viewed 249 times

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

Re: EPD Library for Arduino

by mamcgu on Wed Apr 28, 2021 11:42 pm

I can't tell from your picture exactly where the wires go. Is it this?
SCK to pin 13
MISO to pin 12
MOSI to pin 11
ECS to pin 10
D/C to pin 9
SRCS to pin 8
RST to pin 5
BUSY to pin 3
??
(If it is, I have tried that.)

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Thu Apr 29, 2021 10:05 am

For the SPI connections, yes:
SCK to pin 13
MISO to pin 12
MOSI to pin 11

For the rest, per the guide:
https://learn.adafruit.com/adafruit-2-1 ... -3085380-1
ECS to pin 9
D/C to pin 10
SRCS to pin 6
RST to pin 8
BUSY to pin 7

Also, SDCS is on 5, but not used in the above sketch.

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

Re: EPD Library for Arduino

by mamcgu on Thu Apr 29, 2021 5:47 pm

EPD display debug.jpg
EPD display debug.jpg (460.97 KiB) Viewed 232 times
Some progress. See attached. Large text garbagey but readable, small text unrecognizable. This is using your code and your pin assignments.
There are two different Fritzing diagrams for Arduino hookup on the site, both different. The one whose URL end in 1615416258 is closest to yours.
I uncommented this line:
Adafruit_SSD1680 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
This is still unsatisfactory.

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Thu Apr 29, 2021 6:10 pm

OK, I think we're close. I was using the monochrome version. You have the tri-color version. So try switching to this example sketch:
https://github.com/adafruit/Adafruit_EP ... icolor.ino

The pins should be fine as is.

Then try using one of these initializers:
Code: Select all | TOGGLE FULL SIZE
// 2.13" Tricolor EPD with SSD1680 chipset
//ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

// 2.13" Tricolor EPD with IL0373 chipset
//ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

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

Re: EPD Library for Arduino

by mamcgu on Thu Apr 29, 2021 11:11 pm

Success. Thank you for your patience. I have been needing a daylight-readable display that draws little power.
Attachments
EPD display debug suucess.jpg
EPD display debug suucess.jpg (471.38 KiB) Viewed 228 times

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Re: EPD Library for Arduino

by adafruit_support_carter on Fri Apr 30, 2021 9:51 am

Woot! Yay. Sorry it took so long. Glad it's working now. Have fun!

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

Re: EPD Library for Arduino

by mamcgu on Fri Apr 30, 2021 8:56 pm

One last question: The program you suggested displays text, squares, etc first in negative (white on black) then positive. Looking at the code, I can't see how this happens. Is it the "display.display()" command? On Github, hitting "docs" brings up a blank page...?

mamcgu
 
Posts: 10
Joined: Tue Apr 20, 2021 8:38 pm

Please be positive and constructive with your questions and comments.