lexus2k / ssd1306

Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drawing and clearing the screen is slow

chutsu opened this issue · comments

Please provide the following information:

library version

Master branch - commit version 54c9888

LCD display type

Adafruit SSD1351

Steps to reproduce the issue

ssd1351_128x128_spi_init(25, 0, 24);
ssd1351_setMode(LCD_MODE_NORMAL);
ssd1306_setFixedFont(ssd1306xled_font6x8);
ssd1306_clearScreen();

Expected behavior

Was expecting the ssd1306 functions to draw and clear the screen instantly.

Actual behavior

The display is drawn and cleared line by line, top to bottom. See video here

In the video I basically call this function to draw on the screen here. The screen is initialized here

Hello,

Did you try Adafruit SSD1351 library? Is it faster?
Are you using Arduino Nano, or something else (ESP32/Raspberry)?

To fill the screen content, it is required to send at least 32KiB of data. I'm telling "at least", because except payload, library needs to send commands. That's about 300kbit of data to clear the screen. Even at max available speed Arduino Nano gives only ~ 5-6 frames over SPI.
So, reducing SPI speed (using software implementation instead of hardware) greatly slows down display operations.

I'm actually driving the display via a Raspberry Pi Zero W. I've tried using Luma OLED and have been able to instantly draw and clear the screen without any problems, but its in Python and I needed a C++ version for the display driver, thats why I chose your library.

Ok, I see.

I need to debug on my setup (raspberry pi 2+). According to this forum https://www.raspberrypi.org/forums/viewtopic.php?t=177965 ioctl in ssd1306 library sets write speed correctly.
Did you try spidev_test, described here: https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md#troubleshooting. What are the results?

I reproduced described behavior on my raspberry, now debugging. As soon as I have solution, I will let you know.
It seems, I fixed the issue. Performing tests now and preparing commit.

Please, check commit 2d6e33e let me know if it helps.
You can get latest master sources

Thanks! Can confirm the fix does indeed fix the slow update.