Speed Memory display

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
blnkjns
 
Posts: 963
Joined: Fri Oct 02, 2020 3:33 am

Speed Memory display

Post by blnkjns »

I am playing a bit with the Sharp Memory Display, the "Playdate" screen on a Metro M4.
I've a simple piece of Arduino code that writes the whole screen black, then white, over and over.
On the standard setting it achieves 10 FPS, on "Here be dragons", with SPI at 1/2 processor speed and 200MHz overclock I can push it to 16.7 fps.
Should it be possible to reach 30 or even 60fps?

Code: Select all

#include <Adafruit_GFX.h>
#include <Adafruit_SharpMem.h>
#define WIDTH  400
#define HEIGHT 240
#define CS     10
Adafruit_SharpMem display(SCK,MOSI,CS,WIDTH,HEIGHT);
int frameCount=0;
float fps;
unsigned long startTime;

void setup(void)
{
  Serial.begin(9600);
  display.begin();
  display.clearDisplay();
  startTime=millis();
}

void loop(void){
  frameCount++;
  Flicker(frameCount);
  fps=float(scroll)*1000/float(millis()-startTime);
  Serial.println(fps,1);
}

void Flicker(int offsetx){
  for(unsigned x=0; x<WIDTH; ++x){
    for(unsigned y=0; y<HEIGHT; ++y){
      display.drawPixel(x,y,offsetx%2);
    }
  }
  display.refresh();
}
Or is the drawPixel command slowing things down to great extends? Can that be replaced with a simple bitwrite somewhere?

User avatar
blnkjns
 
Posts: 963
Joined: Fri Oct 02, 2020 3:33 am

Re: Speed Memory display

Post by blnkjns »

Just found out that the drawPixel function has some bloat to deal with colours, which is pretty useless on a B&W device.
So this speeds things up quite a bit:

Code: Select all

      bitWrite(display.sharpmem_buffer[(y*WIDTH+x)/8],x%8,offsetx%2);
      //display.drawPixel(x,y,offsetx%2);
I replaced drawPixel by a bitWrite. This gets me to 29fps. It also required to set the sharpmem_buffer to public in the library file Adafruit_SharpMem.h
Or is there a display driver that is true b&w like u2g2? The Adafruit GFX compatible ones usually support 16 bit colour.

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

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”