Help using Adafruit Sharp Memory Display 2.7" with Teensy 4.

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
JakeThePog
 
Posts: 3
Joined: Mon Oct 26, 2020 12:28 pm

Help using Adafruit Sharp Memory Display 2.7" with Teensy 4.

Post by JakeThePog »

Hi! I've picked up a Teensy 4.0 as it has the power to run one the Adafruit Sharp Mem 2.7 Display: https://www.adafruit.com/product/4694
It also has the storage & memory to do what I want to do as far as I understand it.

Image below showing where I'm at. I've got it set up with the following:

Code: Select all

Breakout > Teensy 4.0 —
VIN > 5V
GND > GND
CLK > Pin 6
DI > Pin 5
CS > Pin 4
Image

I've been following the guide here: https://learn.adafruit.com/adafruit-sha ... rogramming
When running sharpmemtest.ino I change the following to reflect my setup:

Code: Select all

#define SHARP_SCK  6
#define SHARP_MOSI   5
#define SHARP_SS   4

Adafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 240, 400);
Unfortunately I keep getting the mostly-black display pictured above, with scattered white pixels too. Unplugging the Teensy has the display fade to white as expected. I've tried a bunch of other things, including the Bad Apple Example which is specific to this display. With that one I ran into plenty of other issues on the coding end which I'd be happy to go into if that would be useful to know.

Any help would be very much appreciated, I'm very much learning here. Thanks for your time!

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

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by mikeysklar »

This looks like a bug in our guide. I see you are using a 5v to the display, but this really should be 3.3v as our Python Wiring shows since your are using a Teensy 4.x (M4) 3.3v chip.

https://learn.adafruit.com/adafruit-sha ... hon-wiring
3v.png
3v.png (142.78 KiB) Viewed 715 times

User avatar
JakeThePog
 
Posts: 3
Joined: Mon Oct 26, 2020 12:28 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by JakeThePog »

Thanks for the response, unfortunately the display doesn't appear to be turning on at all though. I've got it set up same as your diagram, only with CLK, DI & CS plugged into Pins 4, 5, 6 as seen in my pic of the Teensy 4.0.

You linked to the CircuitPython section of the guide, should I be using this? I've been using Teensyduino and trying to run the sharpmemtest.ino.

On the subject of my display failing to turn on at all, it does seem a bit temperamental — sometimes it'll be black with scattered white pixels, sometimes black with scattered pixels slightly more focused in rows, and other times it stays white/off. It seems to happen at random when connected to USB, and it's been a while since I had it turn on at all.

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

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by mikeysklar »

It looks to me like you are power the display from the 5v on the Teensy. That must be 3v3 for the i2c interface to work. The Teensy 4.x is a 3v3 microcontroller.

Also the GND pin on the display is that aligned correctly? From your photo it looks as though it might be on the display 3v pin.

User avatar
clampron
 
Posts: 17
Joined: Thu Jun 22, 2017 2:48 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by clampron »

Did you end up getting this to work? I'm running the exact setup with the same issue. Mostly black screen with speckled dots.

User avatar
JakeThePog
 
Posts: 3
Joined: Mon Oct 26, 2020 12:28 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by JakeThePog »

Glad I'm not the only one having the issue! I tried 5v and 3v3 with no luck.
Decided to give it a break and perhaps look into a microcontroller that's been proven to work with the screen.

If you manage to get it working please let me know!

User avatar
clampron
 
Posts: 17
Joined: Thu Jun 22, 2017 2:48 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by clampron »

I just tried with a Feather M0 and the display still shows nothing. (Example: Adafruit SHARP Memory Display: sharpmemtest)

#include <Adafruit_GFX.h>
#include <Adafruit_SharpMem.h>

#define SHARP_SCK 20
#define SHARP_MOSI 19
#define SHARP_SS 16
featherM0Sharp.jpg
featherM0Sharp.jpg (459.66 KiB) Viewed 650 times
Perhaps a defective board? I've tried many other pin configurations with no success. As previously mentioned, I also tried the Teensy 4.0 with no luck.

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

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by mikeysklar »

@clampron,

Which model of Feather M0 are you using? That looks like a LoRa Radio module on there in which case the pinouts for hardware SPI would be:

SCK/MOSI/MISO (GPIO 24/23/22)- These are the hardware SPI pins, you can use them as everyday GPIO pins (but recommend keeping them free as they are best used for hardware SPI connections for high speed.

This would also be a more complex module to work with than a straight M0 Feather since the Lora is using the same SPI bus and requires a CS pin to switch between devices.

User avatar
clampron
 
Posts: 17
Joined: Thu Jun 22, 2017 2:48 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by clampron »

@mikeysklar:
Here's the M0:
PRODUCT ID: 3176 Adafruit Feather M0 RFM69HCW Packet Radio - 868 or 915 MHz - RadioFruit

I'd prefer getting the SHARP Memory display (order 2402169-7689125805) to work on the Teensy 3.6, 4.0, or 4.1. I have all three if testing is needed.

User avatar
clampron
 
Posts: 17
Joined: Thu Jun 22, 2017 2:48 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by clampron »

@mikeysklar:

I tried your recommended configuration on the M0:

#define SHARP_SCK 24
#define SHARP_MOSI 23
#define SHARP_SS 22

Same result. Blank display
Attachments
m0_v2.jpg
m0_v2.jpg (479.27 KiB) Viewed 647 times

User avatar
clampron
 
Posts: 17
Joined: Thu Jun 22, 2017 2:48 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by clampron »

@mikeysklar:

Here's the Teensy 4.0 with the following config:
#define SHARP_SCK 13
#define SHARP_MOSI 11
#define SHARP_SS 12
teensy_sharp_v1.jpg
teensy_sharp_v1.jpg (395.89 KiB) Viewed 647 times

User avatar
clampron
 
Posts: 17
Joined: Thu Jun 22, 2017 2:48 pm

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by clampron »

Good news: I was able to get the SHARP Memory Display working with the Teensy 3.6.

Unfortunately, the same configuration on the Teensy 4.0 did not work.

I'm assuming it will work on the Teensy LC. (based on what I found here: https://github.com/pdp7/memory-display)

Code: Select all

#include <Adafruit_GFX.h>
#include <Adafruit_SharpMem.h>

#define SHARP_SCK  10    // SCLK
#define SHARP_MOSI 11    // MOSI
#define SHARP_SS   13    // SCK

Adafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 400, 240);
teensy_3_6_sharp_display.jpg
teensy_3_6_sharp_display.jpg (525.51 KiB) Viewed 637 times
Hope this helps someone :)

User avatar
hyperkinetic_dave
 
Posts: 2
Joined: Thu Apr 15, 2021 10:45 am

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by hyperkinetic_dave »

Hey gang,

Did anyone make any progress with the Teensy 4.x and the Sharp Memory Display? I've got it wired up in accordance with the Adafruit documentation but am just getting a blank display:

VIN -> 3.3v
GND -> GND
CLK -> Pin #13
DI -> Pin #11
CS -> Pin #10

I see people have had some success using this display with the Teensy 3.x but I'm really keen on leveraging the power of the 4.1. If anyone has any advice I would be incredibly grateful.

Thanks,

Dave

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

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by mikeysklar »

Dave,

Can you tell how far your code is executing. Are you running the Adafruit example script? I've not seen any success with the Teensy 4.x with this display and I don't know why there is an issue. It seems like a pretty straight forward SPI connection.

https://github.com/adafruit/Adafruit_SH ... emtest.ino

Code: Select all

/*********************************************************************
This is an example sketch for our Monochrome SHARP Memory Displays

  Pick one up today in the adafruit shop!
  ------> http://www.adafruit.com/products/1393

These displays use SPI to communicate, 3 pins are required to
interface

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.
BSD license, check license.txt for more information
All text above, must be included in any redistribution
*********************************************************************/

#include <Adafruit_GFX.h>
#include <Adafruit_SharpMem.h>

// any pins can be used
#define SHARP_SCK  13
#define SHARP_MOSI 11
#define SHARP_SS   10

// Set the size of the display here, e.g. 144x168!
Adafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 144, 168);
// The currently-available SHARP Memory Display (144x168 pixels)
// requires > 4K of microcontroller RAM; it WILL NOT WORK on Arduino Uno
// or other <4K "classic" devices!  The original display (96x96 pixels)
// does work there, but is no longer produced.

#define BLACK 0
#define WHITE 1

int minorHalfSize; // 1/2 of lesser of display width or height

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");

  // start & clear the display
  display.begin();
  display.clearDisplay();

  // Several shapes are drawn centered on the screen.  Calculate 1/2 of
  // lesser of display width or height, this is used repeatedly later.
  minorHalfSize = min(display.width(), display.height()) / 2;

  // draw a single pixel
  display.drawPixel(10, 10, BLACK);
  display.refresh();
  delay(500);
  display.clearDisplay();

  // draw many lines
  testdrawline();
  delay(500);
  display.clearDisplay();

  // draw rectangles
  testdrawrect();
  delay(500);
  display.clearDisplay();

  // draw multiple rectangles
  testfillrect();
  display.refresh();
  delay(500);
  display.clearDisplay();

  // draw a circle, 10 pixel radius
  display.fillCircle(display.width()/2, display.height()/2, 10, BLACK);
  display.refresh();
  delay(500);
  display.clearDisplay();

  testdrawroundrect();
  display.refresh();
  delay(500);
  display.clearDisplay();

  testfillroundrect();
  display.refresh();
  delay(500);
  display.clearDisplay();

  testdrawtriangle();
  display.refresh();
  delay(500);
  display.clearDisplay();

  testfilltriangle();
  display.refresh();
  delay(500);
  display.clearDisplay();

  testdrawchar();
  display.refresh();
  for(int i=0; i<4; i++) {
    display.refresh();
    delay(500);
  }
}

void loop(void) 
{
  for(int i=0; i<4; i++) {
    display.setRotation(i);
    display.clearDisplay();
    // text display tests
    display.setTextSize(1);
    display.setTextColor(BLACK);
    display.setCursor(0,0);
    display.println("Hello, world!");
    display.setTextColor(WHITE, BLACK); // inverted text
    display.println(3.141592);
    display.setTextSize(2);
    display.setTextColor(BLACK);
    display.print("0x"); display.println(0xDEADBEEF, HEX);
    // Screen must be refreshed at least once per second
    for(int j=0; j<4; j++) {
      display.refresh();
      delay(500); // 1/2 sec delay
    } // x4 = 2 second pause between rotations
  }
}

///

void testdrawline() {
  for (int i=0; i<display.width(); i+=4) {
    display.drawLine(0, 0, i, display.height()-1, BLACK);
    display.refresh();
  }
  for (int i=0; i<display.height(); i+=4) {
    display.drawLine(0, 0, display.width()-1, i, BLACK);
    display.refresh();
  }
  delay(250);

  display.clearDisplay();
  for (int i=0; i<display.width(); i+=4) {
    display.drawLine(0, display.height()-1, i, 0, BLACK);
    display.refresh();
  }
  for (int i=display.height()-1; i>=0; i-=4) {
    display.drawLine(0, display.height()-1, display.width()-1, i, BLACK);
    display.refresh();
  }
  delay(250);

  display.clearDisplay();
  for (int i=display.width()-1; i>=0; i-=4) {
    display.drawLine(display.width()-1, display.height()-1, i, 0, BLACK);
    display.refresh();
  }
  for (int i=display.height()-1; i>=0; i-=4) {
    display.drawLine(display.width()-1, display.height()-1, 0, i, BLACK);
    display.refresh();
  }
  delay(250);

  display.clearDisplay();
  for (int i=0; i<display.height(); i+=4) {
    display.drawLine(display.width()-1, 0, 0, i, BLACK);
    display.refresh();
  }
  for (int i=0; i<display.width(); i+=4) {
    display.drawLine(display.width()-1, 0, i, display.height()-1, BLACK);
    display.refresh();
  }
  delay(250);
}

void testdrawrect(void) {
  for (int i=0; i<minorHalfSize; i+=2) {
    display.drawRect(i, i, display.width()-2*i, display.height()-2*i, BLACK);
    display.refresh();
  }
}

void testfillrect(void) {
  uint8_t color = BLACK;
  for (int i=0; i<minorHalfSize; i+=3) {
    // alternate colors
    display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color&1);
    display.refresh();
    color++;
  }
}

void testdrawroundrect(void) {
  for (int i=0; i<minorHalfSize/2; i+=2) {
    display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, minorHalfSize/2, BLACK);
    display.refresh();
  }
}

void testfillroundrect(void) {
  uint8_t color = BLACK;
  for (int i=0; i<minorHalfSize/2; i+=2) {
    display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, minorHalfSize/2, color&1);
    display.refresh();
    color++;
  }
}

void testdrawtriangle(void) {
  for (int i=0; i<minorHalfSize; i+=5) {
    display.drawTriangle(display.width()/2, display.height()/2-i,
                     display.width()/2-i, display.height()/2+i,
                     display.width()/2+i, display.height()/2+i, BLACK);
    display.refresh();
  }
}

void testfilltriangle(void) {
  uint8_t color = BLACK;
  for (int i=minorHalfSize; i>0; i-=5) {
    display.fillTriangle(display.width()/2  , display.height()/2-i,
                         display.width()/2-i, display.height()/2+i,
                         display.width()/2+i, display.height()/2+i, color & 1);
    display.refresh();
    color++;
  }
}

void testdrawchar(void) {
  display.setTextSize(1);
  display.setTextColor(BLACK);
  display.setCursor(0,0);
  display.cp437(true);

  for (int i=0; i < 256; i++) {
    if (i == '\n') continue;
    display.write(i);
  }
  display.refresh();
}


User avatar
hyperkinetic_dave
 
Posts: 2
Joined: Thu Apr 15, 2021 10:45 am

Re: Help using Adafruit Sharp Memory Display 2.7" with Teens

Post by hyperkinetic_dave »

Hey! Thanks so much for replying so quickly!

I am using the Adafruit memtest example script and the screen remains blank and as far as I can tell the arduino is happy everything is working (the begin function returns true / 1). I am using the pins as indicated in the example:

VIN -> 5v
GND -> GND
CLK -> 13
DI -> 11
CS -> 10

It is interesting because the circuitpython example found here appears to work perfectly! (https://learn.adafruit.com/adafruit-sha ... ayio-usage).

I am reasonably new to this field and did spot something interesting on the official Teensy website - the column for SS doesn't have a value for the 4.1 (https://www.pjrc.com/teensy/td_libs_SPI.html).

One thing I noticed is that the chip select pin is active HIGH, which I believe is not the norm - again I'm not that experienced in this field but I thought it would be worth mentioning...

Thanks for your help, and for making such exciting products!

Dave

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

Return to “Other Products from Adafruit”