Adafruit_CircuitPython_CharLCD icon indicating copy to clipboard operation
Adafruit_CircuitPython_CharLCD copied to clipboard

Message draw slow compared to legacy library (Adafruit_CharLCDPlate)

Open LamptonWorm opened this issue 4 years ago • 11 comments

Hi,

I'm using one of the older Adafruit i2c 16x2 RGB LCD Pi Plates with a Rasp. Pi 2 Model B v1.1 CircuitPython_CharLCD is working fine, but message draw is slow compared to the legacy library here https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/legacy/Adafruit_CharLCDPlate. You can see each letter drawing in turn, whereas the legacy code is almost instant.

Thanks,

LamptonWorm avatar Jan 23 '21 13:01 LamptonWorm

Same experience here. It makes using a menu rather unpleasant.

Arnwaltur avatar Jul 16 '22 08:07 Arnwaltur

Also noticed the same problem. The slow refresh makes any updates to the display very jarring compared to the old library. Any plans to update this library? Any luck by others to increase the draw speed or did you just revert to the old library?

Update: Using 2to3 to convert the legacy library works just fine to run under python3 with full redraw speed.

szyg avatar Jul 29 '22 16:07 szyg

are you both using older raspi computers? its a little slower here due to a refactor

ladyada avatar Aug 01 '22 18:08 ladyada

I am running on a Pi 3b model a22082. New library displays with a very distracting left to right sweep on every redraw where the old is barely a flicker. Running Raspberry OS 11 Bullseye if that is useful. Using the converted legacy library is working great for now.

szyg avatar Aug 01 '22 19:08 szyg

@Neradoc do you want to try improving the performance? basically we should write 4 bits at a time rather than using DigitalIO which is more elegant but slower

ladyada avatar Aug 01 '22 21:08 ladyada

I wrote my own char LCD library a long time ago for PCF8574 chips: https://github.com/dhalbert/CircuitPython_LCD. It does 4-bit writes. I think it could be adapted to the MCP23008 supported by this library. It is also factored in such a way that the chip-specific logic is separate from the main library.

dhalbert avatar Aug 01 '22 21:08 dhalbert

@ladyada Yes, using Pi 1 & 2. It is slow and the CPU load is high compared to the old library. I use it for a web radio, and it's not uncommon for the sound to chop when the screen displays new text.

Arnwaltur avatar Aug 02 '22 09:08 Arnwaltur

Hi, just to confirm, yes I was also seeing this on an older Pi 2 Model B v1.1 .. thanks!

LamptonWorm avatar Aug 05 '22 10:08 LamptonWorm

I just bought the I2C/SPI backpack (#292) with a _Standard LCD 16x_2 (#181) and am using it with a MCP2221 (#4471) on a PC running Debian 11. It takes over 6 seconds to write "Hello CircuitPython" to the display.

I tried it on a Windows 10 PC with the same result.

I found the display update speed does not change when I switch the MCP2221's I2C speed from 100kHz to 400kHz.

This is almost completely useless, I could even live with 1 second to write 19 characters but >6 seconds is not useful.

PaulHutchInMA avatar Sep 14 '23 11:09 PaulHutchInMA

If there isn't any easy way to fix the data transmission speed issue, is there any way to buffer the screen data and then update it all at once? The docs didn't mention anything like that, so I'm guessing no, but I might be wrong. I'm just hoping to find a way to get more responsiveness with this library.

ChaoticPumpkin avatar Sep 29 '23 17:09 ChaoticPumpkin

yes someone could help write a variant of this library that can write the 4 data bits at once instead of one at a time, optimizations would help but of course would have to be implemented for each chipset

ladyada avatar Sep 30 '23 16:09 ladyada