adafruit / Adafruit_CircuitPython_CharLCD

Library code for character LCD interfacing
MIT License
68 stars 48 forks source link

Message draw slow compared to legacy library (Adafruit_CharLCDPlate) #55

Open LamptonWorm opened 3 years ago

LamptonWorm commented 3 years ago

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,

Arnwaltur commented 1 year ago

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

szyg commented 1 year ago

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.

ladyada commented 1 year ago

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

szyg commented 1 year ago

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.

ladyada commented 1 year ago

@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

dhalbert commented 1 year ago

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.

Arnwaltur commented 1 year ago

@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.

LamptonWorm commented 1 year ago

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

PaulHutchInMA commented 9 months ago

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.

ChaoticPumpkin commented 9 months ago

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.

ladyada commented 9 months ago

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