Adafruit sharp module

Status
Not open for further replies.
Posting the error messages would help in diagnosis.

having looked at other Adafruit code, however, they do tend to use AVR direct port manipulation (for example, to switch I2C speed) which requires porting for ARM platforms.
 
I am considering buying a module for someone that has the ability to write the library for the Teensy 3 and make the library smart enough to switch between the static and dynamic modes
 
Casting a quick eye over the code, I see that once again Adafruit use software bit-banged SPI to talk to the display. Its not clear why they do this. They do the same thing in the library for the 128x64 oled display, which I have bought and will be working on when it arrives.

I downloaded the Sharp library and it compiled without error for both Teensy 2.0 and Teensy 3.0. I don't have the actual hardware so can't actually test if it works. If you are getting errors, perhaps you didn't notice that the Adafruit-GFX-Library must also be installed?
 
Please send me your address and I will order a module for you. I really don't mind paying for a module to get this sorted
 
I deleted Teensy3_ST7735 from my libraries to get it to compile

From what I am seeing it seems the sharp might use less power than the oled if you use more static images. Why do you prefer the oled?
 
Thanks for the offer, but it seems that the Sharp display should work out of the box. And if it doesn't, I don't have any especial expertise in library development.

The application I have in mind is mains powered, so power consumption is not a primary concern; legibility in low light looks better and the form factor is also better for this application, where space is also a concern.
 
I just ordered one from Adafruit.

I can't promise when I'll be able to actually do much with it.... but it'll likely arrive early next week, so the end of next week might be a good time to ask how it's going.
 
Paul have you had time to look at this? I connected one this morning to my Teensy. First I had just pixels and now I have nothing showing up

These are the pins I used and I tried different combinations on the screen
20 DISP_SS
13 DISP_SCK
11 DISP_MOSI

I assumed since the previous LCD that I connected directly to the Teensy didn't blow the Teensy this display wouldn't so I just connected the power directly to the Teensy. 3.3V from Teensy to 3.3V-5V of the display and then 3.3V from Teensy to the 3.3V of the display.
 
I spent the last 2 days studying all the code I could find relating to this module and I learnt SPI

This is the beginning. I can draw lines :)

Code:
#include <SPI.h>
const int slaveSelectPin = 10;

void setup() {
  // set the slaveSelectPin as an output:
  pinMode (slaveSelectPin, OUTPUT);
  // initialize SPI:
  SPI.begin(); 
  Serial.begin(9600);
  
  clearDisplay();  
  delay(1000);  
}

#define MLCD_WR 0x80					// MLCD write line command
#define MLCD_CM 0x20					// MLCD clear memory command
#define MLCD_SM 0x00					// MLCD static mode command
#define MLCD_VCOM 0x40					// MLCD VCOM bit

byte currentVcomState = MLCD_VCOM;
byte currentLine = 0;

void loop() {
  currentVcomState = currentVcomState ? 0x00 : MLCD_VCOM;
  currentLine >= 96 ? 0 : currentLine++;
  
  Serial.print(currentVcomState);
  Serial.print(" ");
  Serial.println(currentLine);
  
  drawLine(currentLine);
  delay(1000);
}

void clearDisplay() {
  digitalWrite(slaveSelectPin,HIGH);
  SPI.transfer(MLCD_CM | currentVcomState);
  Serial.print("clear screen ");
  Serial.println(MLCD_CM | currentVcomState);
  SPI.transfer(0x00);
  digitalWrite(slaveSelectPin,LOW);
}

void drawLine(byte lineNumber) {
  digitalWrite(slaveSelectPin,HIGH);
  SPI.transfer(MLCD_WR | currentVcomState);
  SPI.transfer(lineNumber);
  for (int i = 0; i < 12; i++) {
    SPI.transfer(1);
  }
  SPI.transfer(0x00);
  digitalWrite(slaveSelectPin,LOW);
}
 
I tried the Adafruit library again, but this time on an Arduino. It worked fine. I then tried it again on the Teensy 3 and the same sketch worked. I probably used the wrong pins on the Teensy or the rest of my weapon code messed up what the library was doing. I need to try and integrate it into the rest of my code to see if I can get it working

It would probably still be nice to rather use the SPI library. I saw the demo was flying when I set the Teensy to 96Mhz. Some parts where so fast it didn't even render correctly. I won't need max speed so the Adafruit library will work fine for me at this point I believe
 
So did everybody get the Sharp Memory LCD screen working with the Teensy 3.1?

I have a 128x128 pixel & and a 400x240 pixel sharp memory display that I would like to get working with the Sharp memory displays since the Teensy 3.1 is really the only board out there that has enough Sram to buffer the 400x240 pixel screen size thats easy for me to use.

I am using these breakout boards https://www.tindie.com/products/kuzyatech/sharp-memory-lcd-breakout-a2/

I trying to load Adafruits Sharp Memory Demo Code with the GFX library.

I need help with changing the pins so they work right with this breakout board.

Any help is appreciated!
 
I just ordered one from Adafruit.

I can't promise when I'll be able to actually do much with it.... but it'll likely arrive early next week, so the end of next week might be a good time to ask how it's going.

Hey Paul did you ever get the Sharp Memory LCD working on the Teensy 3.1? I would like to use the Teensy 3.1 since it has enough SRAM to run the 2.7 inch Sharp Memory LCD that requires like 18,000 bites of SRAM to buffer the display but I can't get the adafruit code for these screens up and running.

Did you ever get yours setup and running on your boards?
 
I used the SharpMemoryLCD library referenced above on an Arduino UNO and got it to work with the Old Adafruit GFX library referenced on the Github page. I tried to use these with the Teensy 3.1 but it would not compile.
C:\Program Files (x86)\Arduino\libraries\SharpMemoryLcd\SharpMemoryLcd.cpp:118:3: error: 'TCCR2B' was not declared in this scope
Has anyone else had any success with these?
 
I used the SharpMemoryLCD library referenced above on an Arduino UNO and got it to work with the Old Adafruit GFX library referenced on the Github page. I tried to use these with the Teensy 3.1 but it would not compile.
C:\Program Files (x86)\Arduino\libraries\SharpMemoryLcd\SharpMemoryLcd.cpp:118:3: error: 'TCCR2B' was not declared in this scope
Has anyone else had any success with these?

I have not got it working yet and I have not received a reply from anybody on the forum as you can see so I'm not sure what to do.

The Teensy 3.1 is the only Arduino IDE compatible processor that I can find that has enough SRAM to buffer the images for the 128x128 and 400x240 sized Sharp Memory LCD Screens that I want to use.

Paul S said he had ordered the Sharp Memory Display to test out but never replied with his experience with it. I'm sure he can tell us how to get it going but I'm not sure how to get his attention on the forum.

If anybody can help us out it would be greatly appreciated.
 
I used the SharpMemoryLCD library referenced above on an Arduino UNO and got it to work with the Old Adafruit GFX library referenced on the Github page. I tried to use these with the Teensy 3.1 but it would not compile.
C:\Program Files (x86)\Arduino\libraries\SharpMemoryLcd\SharpMemoryLcd.cpp:118:3: error: 'TCCR2B' was not declared in this scope

Please post a link to the download for this library.

I looked here:

https://github.com/adafruit/Adafruit_SHARP_Memory_Display/blob/master/Adafruit_SharpMem.cpp

"TCCR2B" does not appear on line 118 or anywhere else in this copy.
 
I am trying to use the sharp Memory LCD's and was looking for something that works to have a starting point. In this thread I saw Solardude's post
I followed that link and downloaded the libraries, which still did not work with the GFX library. I saw the comment in the issues page of Github and tried the old library and it worked with an Uno.
I tried the same combination with teensy 3.1 and it did not work.
I see from this thread that you were trying these displays last year so I was offering some start point. I would really like to get them working as they seem ideal for Teensy and my application for ultra low power.
Thanks
 
Why are you using such an ancient version?

Paul are you able to get your Sharp Memory LCD working with the current Adafruit Sharp Memory library + the current Adafruit GFX library?

I'll pay you to get it working, or send you a screen and board if you do not still have one handy.
 
I got the Sharp LCD working with the Teensy 3.1 by using the current Adafruit Sharp Memory Library + GFX Library + the Kuzytech breakout board. I had to just place the Display line from the breakout board to the 5v input line to get the screen to light up. I was using the 128x128 pixel display. Just had to change the pixel dimension in the .h file for the Adafruit Demo.

Here is a quick video of the 2.7 inch display running.

https://www.youtube.com/watch?v=qak_DzRdYtU&feature=youtube_gdata_player
 
Last edited:
I got the Sharp LCD working with the Teensy 3.1 by using the current Adafruit Sharp Memory Library + GFX Library + the Kuzytech breakout board. I had to just place the Display line from the breakout board to the 5v input line to get the screen to light up. I was using the 128x128 pixel display. Just had to change the pixel dimension in the .h file for the Adafruit Demo.

Here is a quick video of the 2.7 inch display running.

https://www.youtube.com/watch?v=qak_DzRdYtU&feature=youtube_gdata_player

Hi! Can you share sketch and libraries sources?
 
This works with teensy 4.0 and 400x240 display.

The bit order of commands is reversed just to make it more understandable.

The for (int i = 0; i <50; i++) {SPI.transfer(0b10010010); } draws the pixels. (50 x 8 = 400 pixels per line)

This is really simple display to control, it is all explained here https://www.sharpsde.com/fileadmin/..._App_Note_for_Memory_LCD_programming_V1.3.pdf

Code:
#include <SPI.h>
#define CS 10


// MLCD write line command 0x80, reversed 0x01
// MLCD clear memory command 0x20, reversed 0x04
// MLCD static mode command 0x00 
// MLCD VCOM bit 0x40 , reversed 0x02

byte Vcom;
byte Line;

void setup() {
  
  pinMode (10, OUTPUT);
  SPI.begin(); 
  SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0));
  
  clearDisplay();  
  delay(1000);  
}

void loop() {
  
  Vcom = Vcom ? 0x00 : 0x02;

  if (Line < 240) {Line++;} else {Line =0; clearDisplay();}
  
  Serial.print(Vcom);
  Serial.print(" ");
  Serial.println(Line);
  
  drawLine(Line);
  delay(30);
}

void clearDisplay() {
  digitalWrite(CS,HIGH);
  SPI.transfer(0x04 | Vcom);
  Serial.print("clear screen ");
  Serial.println(0x04 | Vcom);
  SPI.transfer(0x00);
  digitalWrite(CS,LOW);
}

void drawLine(byte lineNumber) {
  
  digitalWrite(CS,HIGH);
  SPI.transfer(0x01 | Vcom); //write line command (bits reversed)
  SPI.transfer(lineNumber);
  for (int i = 0; i <50; i++) {
    SPI.transfer(0b10010010);
  }
  SPI.transfer(0x00);
  SPI.transfer(0x00);
  SPI.endTransaction();
  digitalWrite(CS,LOW);
}
 
Status
Not open for further replies.
Back
Top