0

1.54" 200x200 epaper - Can't get it to work
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

1.54" 200x200 epaper - Can't get it to work

by yuvrajD on Sun Jun 20, 2021 9:04 am

Hi there!
I am building a prototype around the nRF52840 board - I have the Nordic Development Kit not the Feather.
Hence I recognise I am quite an edge case here...
So I am developing in VSCode + PlatformIO, I have flashed the Adafruit bootloader on the Development Kit and it works great.
I am able to upload code, get serial logging over USB just fine.
However, I cannot for the life of me get my eInk display to work! The thing with the nRF52840 is it does not have set hardware SPI pins, it will happily do SPI on any set of pins. So I looked at the constructor method for the Adafruit display() object and found an overload that could take SCK, MOSI and MISO pins for software SPI. Firstly I got very confused over the pin mapping from Px.xx to Arduino environment - I figured it out by looking at the featherexpress C header file (it's the number after the point + 32 multiplied by the number before the point for anyone else with the same issue!). I then put the right pins into the code.
None of the examples I tried worked, I checked my connections at least 15 times. Then I thought that the inbuilt CR2032 wasn't providing a high enough voltage for the ePaper (2.998V) confirmed by the 3.3V output on the ePaper being ~2.7V.
I then powered the Development Kit via my external lab supply @ 3.6V, but the display still doesn't do anything when I run the example code.
My setup:
IMG_1530-min.JPG
IMG_1530-min.JPG (888.78 KiB) Viewed 117 times

dkpinout.png
dkpinout.png (856.49 KiB) Viewed 117 times


- and my code is pasted below...
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"
#include <Wire.h>

#define MOSI        40
#define MISO        26
#define SCK         27
#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(MOSI, SCK, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, MISO, EPD_BUSY);

void testdrawtext(const char*, uint16_t);

void setup() {
  Serial.begin(9600);
  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(const char *text, uint16_t color) {
  display.setCursor(0, 0);
  display.setTextColor(color);
  display.setTextWrap(true);
  display.print(text);
}


Any help would be greatly appreciated!

yuvrajD
 
Posts: 3
Joined: Sun Jun 20, 2021 8:19 am

Re: 1.54" 200x200 epaper - Can't get it to work

by yuvrajD on Mon Jun 21, 2021 5:05 am

Update:
I switched to Arduino IDE and used the ThinkInk demo instead - I changed around my pins a bit and I now have the display flashing!
It will not display anything still but it does the refresh from black to white now - perhaps the software SPI is now working?
It would not respond at all to setting the ThinkInk class to D67, upon changing this to D27 it started refreshing.
I ordered this display from Pimoroni not Adafruit, is it possible it was an older batch?

yuvrajD
 
Posts: 3
Joined: Sun Jun 20, 2021 8:19 am

Re: 1.54" 200x200 epaper - Can't get it to work

by yuvrajD on Mon Jun 21, 2021 8:46 am

Update 2:

I have just tried with an Arduino Micro and it's working beautifully!
So that rules out the display being dodgy, better double check my wiring again.......

yuvrajD
 
Posts: 3
Joined: Sun Jun 20, 2021 8:19 am

Please be positive and constructive with your questions and comments.