Issues with E-ink Gizmo

Play with it! Please tell us which board you're using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ncmikkelsen
 
Posts: 7
Joined: Tue Sep 13, 2016 8:01 am

Issues with E-ink Gizmo

Post by ncmikkelsen »

Hi everyone,

I have issues with 2 E-ink Gizmos seeming dead out of the box. I have tried with both of the gizmos with two different circuit playground express boards with no result. The boards work with other example sketches.

I made sure that all the libraries are installed and updated (installed through the library manager), the board is updated to the newest versions and I am using the "Adafruit Circuit Playground Express" from "Arduino SAMD Boards (32-bit ARM Cortex-M0+) installed through the Boards Manager.

I've removed the orange tape and also checked the ribbon cable on both gizmos.

I've followed the tutorial here (https://learn.adafruit.com/adafruit-cir ... -ink-gizmo) and tried both the "GizmoTest" code and the two examples using circuitpython with no luck.

Any idea what to try from here?

I've attached pictures to show the gizmo is (hopefully) oriented and attached correctly.

Best,
Nikolaj
Attachments
IMG_20201208_111435.jpg
IMG_20201208_111435.jpg (279.48 KiB) Viewed 611 times
IMG_20201208_111423.jpg
IMG_20201208_111423.jpg (470.26 KiB) Viewed 611 times

User avatar
mikeysklar
 
Posts: 14179
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with E-ink Gizmo

Post by mikeysklar »

Since this is happening on two different E-Ink Gizmo boards. I'm guessing that it is either a memory issue or a CircuitPython/Library/Bootloader problem that needs to be resolved.

Which version of CircuitPython are you running? v6.0.1 is our current can you update to that?

https://circuitpython.org/board/circuit ... d_express/

Please make sure to update the libraries as well /lib folder use the MPY 6.x bundle (20201013 or later). Destroying the original /lib contents on your CPX board.

https://circuitpython.org/libraries

Also update the bootloader to v3.10.0 (bottom right, scroll down):

https://circuitpython.org/board/circuit ... d_express/

Once everything is confirmed updated. Please provide the output from the REPL prompt when GizmoTest code is being run.

User avatar
ncmikkelsen
 
Posts: 7
Joined: Tue Sep 13, 2016 8:01 am

Re: Issues with E-ink Gizmo

Post by ncmikkelsen »

With everything updated and circuitpython installed from here (https://adafruit-circuit-python.s3.amaz ... yio/en_US/) to have displayio included, the display is now working with circuitpython.

However, I am still not able to get it working with arduino following this guide: https://learn.adafruit.com/adafruit-cir ... duino-code
All the libraries are updated but no luck.

Best,
Nikolaj

User avatar
mikeysklar
 
Posts: 14179
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with E-ink Gizmo

Post by mikeysklar »

Thank you for confirming that everything is a go with the CircuitPython code.

On the Arduino side let's get into which library versions you are using, bootloader and code example you are running. Unfortunately, it is not clear enough to say they are up to date as we have various sources to pull from.

User avatar
ncmikkelsen
 
Posts: 7
Joined: Tue Sep 13, 2016 8:01 am

Re: Issues with E-ink Gizmo

Post by ncmikkelsen »

Apologies for the (very) late response. Regarding library versions I was refering to the newest available version from the arduino library manager, as I assumed those would be the most recent stable versions.
I just updated and testet again today, but still no luck. Here are the specifics:

Bootloader:
Updated the bootloader with "update-bootloader-circuitplay_m0-v3.13.0.uf2" found on https://github.com/adafruit/uf2-samdx1/ ... ag/v3.13.0 as indicated in your guide here: https://learn.adafruit.com/adafruit-cir ... bootloader

Libraries:
Adafruit EPD v.4.4.0
Adafruit GFX Library v.1.10.7
Adafruit BusIO v.1.7.3
Adafruit ImageReader Library v.2.6.1
Adafruit SPIFlash v.3.4.1
SdFat - Adafruit Fork v.1.2.3

Code example:
"GizmoTest" from "Examples" -> "Examples from Custom libraries" -> "Adafruit EPD" -> "GizmoTest" as indicated in your guide here: https://learn.adafruit.com/adafruit-cir ... duino-code
Just to make sure, I have tried the initializer for both the 152x152 and the 200x200 but it makes no difference.

I hope this gives you more to work with. Otherwise let me know if you need anything else.

User avatar
mikeysklar
 
Posts: 14179
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with E-ink Gizmo

Post by mikeysklar »

ncmikkelsen,

Thank you for the updated library list and pointer to the example you are trying to run. Since this works fine on the CircuitPython side and is limited to the Arduino IDE I suspect it is a setting. When you look at your board type in the Arduino IDE what is it defined as? Are you using the Adafruit CircuitPlayground as opposed to the Arduino definition?

User avatar
ncmikkelsen
 
Posts: 7
Joined: Tue Sep 13, 2016 8:01 am

Re: Issues with E-ink Gizmo

Post by ncmikkelsen »

Hi again,

The selected board is listed as such:
Board: "Adafruit Circuit Playground Express" -> Arduino SAMD (32-bits ARM Cortex-M0+) Boards -> Adafruit Circuit Playground Express

The "Arduino SAMD (32-bits ARM Cortex-M0+)" boards-package is updated to the latest version (1.8.10) in the boards manager.

User avatar
mikeysklar
 
Posts: 14179
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with E-ink Gizmo

Post by mikeysklar »

You are using the Arduino SAMD Boards package, but I'd like you to use the Adafruit version.

https://learn.adafruit.com/adafruit-fea ... -2854160-7

If you are not seeing the package you might need to update the Additional Boards Manager URL in the Arduino IDE following the instructions here:

https://learn.adafruit.com/add-boards-a ... v164/setup

User avatar
ncmikkelsen
 
Posts: 7
Joined: Tue Sep 13, 2016 8:01 am

Re: Issues with E-ink Gizmo

Post by ncmikkelsen »

Ah, of course. I just installed and tried the adafruit board definition, but no difference.

User avatar
mikeysklar
 
Posts: 14179
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with E-ink Gizmo

Post by mikeysklar »

I see that the ST7735 Arduino library we provide got a significant fix for the software SPI gizmo example 8 days ago. Let's have you give the new example a try and if there are issues please update to the github release of the ST7735 which is currently at v1.7.2

https://github.com/adafruit/Adafruit-ST ... _gizmo.ino

https://github.com/adafruit/Adafruit-ST ... /tag/1.7.2

Code: Select all

/**************************************************************************
  This is a library for several Adafruit displays based on ST77* drivers.

  Works with the Adafruit TFT Gizmo
    ----> http://www.adafruit.com/products/4367

  Check out the links above for our tutorials and wiring diagrams.

  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_GFX.h>    // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>

// Because of the limited number of pins available on the Circuit Playground Boards
// Software SPI is used
#define TFT_CS        0
#define TFT_RST       -1 // Or set to -1 and connect to Arduino RESET pin
#define TFT_DC        1
#define TFT_BACKLIGHT PIN_A3 // Display backlight pin

// You will need to use Adafruit's CircuitPlayground Express Board Definition
// for Gizmos rather than the Arduino version since there are additional SPI
// ports exposed.
#if (SPI_INTERFACES_COUNT == 1)
  SPIClass* spi = &SPI;
#else
  SPIClass* spi = &SPI1;
#endif

// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique
// to each board and not reassignable.
Adafruit_ST7789 tft = Adafruit_ST7789(spi, TFT_CS, TFT_DC, TFT_RST);

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS,
// tradeoff being that performance is not as fast as hardware SPI above.
//#define TFT_MOSI      PIN_WIRE_SDA  // Data out
//#define TFT_SCLK      PIN_WIRE_SCL  // Clock out
//Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

float p = 3.1415926;

void setup(void) {
  Serial.begin(9600);
  Serial.print(F("Hello! ST77xx TFT Test"));

  tft.init(240, 240);                // Init ST7789 240x240
  tft.setRotation(2);  
  pinMode(TFT_BACKLIGHT, OUTPUT);
  digitalWrite(TFT_BACKLIGHT, HIGH); // Backlight on

  Serial.println(F("Initialized"));

  uint16_t time = millis();
  tft.fillScreen(ST77XX_BLACK);
  time = millis() - time;

  Serial.println(time, DEC);
  delay(500);

  // large block of text
  tft.fillScreen(ST77XX_BLACK);
  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. ", ST77XX_WHITE);
  delay(1000);

  // tft print function!
  tftPrintTest();
  delay(4000);

  // a single pixel
  tft.drawPixel(tft.width()/2, tft.height()/2, ST77XX_GREEN);
  delay(500);

  // line draw test
  testlines(ST77XX_YELLOW);
  delay(500);

  // optimized lines
  testfastlines(ST77XX_RED, ST77XX_BLUE);
  delay(500);

  testdrawrects(ST77XX_GREEN);
  delay(500);

  testfillrects(ST77XX_YELLOW, ST77XX_MAGENTA);
  delay(500);

  tft.fillScreen(ST77XX_BLACK);
  testfillcircles(10, ST77XX_BLUE);
  testdrawcircles(10, ST77XX_WHITE);
  delay(500);

  testroundrects();
  delay(500);

  testtriangles();
  delay(500);

  mediabuttons();
  delay(500);

  Serial.println("done");
  delay(1000);
}

void loop() {
  tft.invertDisplay(true);
  delay(500);
  tft.invertDisplay(false);
  delay(500);
}

void testlines(uint16_t color) {
  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, 0, x, tft.height()-1, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, 0, tft.width()-1, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, 0, 0, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(0, tft.height()-1, x, 0, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);
    delay(0);
  }

  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);
    delay(0);
  }
  for (int16_t y=0; y < tft.height(); y+=6) {
    tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);
    delay(0);
  }
}

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

void testfastlines(uint16_t color1, uint16_t color2) {
  tft.fillScreen(ST77XX_BLACK);
  for (int16_t y=0; y < tft.height(); y+=5) {
    tft.drawFastHLine(0, y, tft.width(), color1);
  }
  for (int16_t x=0; x < tft.width(); x+=5) {
    tft.drawFastVLine(x, 0, tft.height(), color2);
  }
}

void testdrawrects(uint16_t color) {
  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=0; x < tft.width(); x+=6) {
    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color);
  }
}

void testfillrects(uint16_t color1, uint16_t color2) {
  tft.fillScreen(ST77XX_BLACK);
  for (int16_t x=tft.width()-1; x > 6; x-=6) {
    tft.fillRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color1);
    tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color2);
  }
}

void testfillcircles(uint8_t radius, uint16_t color) {
  for (int16_t x=radius; x < tft.width(); x+=radius*2) {
    for (int16_t y=radius; y < tft.height(); y+=radius*2) {
      tft.fillCircle(x, y, radius, color);
    }
  }
}

void testdrawcircles(uint8_t radius, uint16_t color) {
  for (int16_t x=0; x < tft.width()+radius; x+=radius*2) {
    for (int16_t y=0; y < tft.height()+radius; y+=radius*2) {
      tft.drawCircle(x, y, radius, color);
    }
  }
}

void testtriangles() {
  tft.fillScreen(ST77XX_BLACK);
  uint16_t color = 0xF800;
  int t;
  int w = tft.width()/2;
  int x = tft.height()-1;
  int y = 0;
  int z = tft.width();
  for(t = 0 ; t <= 15; t++) {
    tft.drawTriangle(w, y, y, x, z, x, color);
    x-=4;
    y+=4;
    z-=4;
    color+=100;
  }
}

void testroundrects() {
  tft.fillScreen(ST77XX_BLACK);
  uint16_t color = 100;
  int i;
  int t;
  for(t = 0 ; t <= 4; t+=1) {
    int x = 0;
    int y = 0;
    int w = tft.width()-2;
    int h = tft.height()-2;
    for(i = 0 ; i <= 16; i+=1) {
      tft.drawRoundRect(x, y, w, h, 5, color);
      x+=2;
      y+=3;
      w-=4;
      h-=6;
      color+=1100;
    }
    color+=100;
  }
}

void tftPrintTest() {
  tft.setTextWrap(false);
  tft.fillScreen(ST77XX_BLACK);
  tft.setCursor(0, 30);
  tft.setTextColor(ST77XX_RED);
  tft.setTextSize(1);
  tft.println("Hello World!");
  tft.setTextColor(ST77XX_YELLOW);
  tft.setTextSize(2);
  tft.println("Hello World!");
  tft.setTextColor(ST77XX_GREEN);
  tft.setTextSize(3);
  tft.println("Hello World!");
  tft.setTextColor(ST77XX_BLUE);
  tft.setTextSize(4);
  tft.print(1234.567);
  delay(1500);
  tft.setCursor(0, 0);
  tft.fillScreen(ST77XX_BLACK);
  tft.setTextColor(ST77XX_WHITE);
  tft.setTextSize(0);
  tft.println("Hello World!");
  tft.setTextSize(1);
  tft.setTextColor(ST77XX_GREEN);
  tft.print(p, 6);
  tft.println(" Want pi?");
  tft.println(" ");
  tft.print(8675309, HEX); // print 8,675,309 out in HEX!
  tft.println(" Print HEX!");
  tft.println(" ");
  tft.setTextColor(ST77XX_WHITE);
  tft.println("Sketch has been");
  tft.println("running for: ");
  tft.setTextColor(ST77XX_MAGENTA);
  tft.print(millis() / 1000);
  tft.setTextColor(ST77XX_WHITE);
  tft.print(" seconds.");
}

void mediabuttons() {
  // play
  tft.fillScreen(ST77XX_BLACK);
  tft.fillRoundRect(25, 10, 78, 60, 8, ST77XX_WHITE);
  tft.fillTriangle(42, 20, 42, 60, 90, 40, ST77XX_RED);
  delay(500);
  // pause
  tft.fillRoundRect(25, 90, 78, 60, 8, ST77XX_WHITE);
  tft.fillRoundRect(39, 98, 20, 45, 5, ST77XX_GREEN);
  tft.fillRoundRect(69, 98, 20, 45, 5, ST77XX_GREEN);
  delay(500);
  // play color
  tft.fillTriangle(42, 20, 42, 60, 90, 40, ST77XX_BLUE);
  delay(50);
  // pause color
  tft.fillRoundRect(39, 98, 20, 45, 5, ST77XX_RED);
  tft.fillRoundRect(69, 98, 20, 45, 5, ST77XX_RED);
  // play color
  tft.fillTriangle(42, 20, 42, 60, 90, 40, ST77XX_GREEN);
}

User avatar
ncmikkelsen
 
Posts: 7
Joined: Tue Sep 13, 2016 8:01 am

Re: Issues with E-ink Gizmo

Post by ncmikkelsen »

Just gave that a go but still no luck. I tried both the code you sent and the one found with the library's example code in case they we're different. I also tried first removing the already installed "ST7735 and ST7789 Library" and then installing the version you linked from a zip-file but that made no difference. I also tried the version of the library from the library manager in arduino since I noticed that the version found there was also 1.7.2 but still nothing.

User avatar
mikeysklar
 
Posts: 14179
Joined: Mon Aug 01, 2016 8:10 pm

Re: Issues with E-ink Gizmo

Post by mikeysklar »

@ncmikkelsen,

I appreciate you trying the updated example code and 1.7.2 release of the ST7735 library. While there is a possibility that a downstream library might need to be updated to github release levels I don't think that is the issue.

Is it possible that youare using a E-Ink Gizmo with a Circuit Playground Classic versus a Circuit Playground Express. I know that the Classic is considered too slow to be usable.

https://github.com/adafruit/Adafruit-ST ... /issues/94

Maybe it is time to open an issue with the library describing how 1.7.2 is not working for you, but CircuitPlayground runs fine.

https://github.com/adafruit/Adafruit-ST ... ary/issues

Locked
Please be positive and constructive with your questions and comments.

Return to “Circuit Playground Classic, Circuit Playground Express, Circuit Playground Bluefruit”