Description
Any tips and tricks on speeding up the frame rate on a 2.8” 480x640 SPI screen using the ST7701 display driver?
What MCU/Processor/Board and compiler are you using?
I’m using the Waveshare ESP32-S3-Touch-LCD-2.8B
What LVGL version are you using?
LVGL 9
What do you want to achieve?
Faster frame rate and rotation.
What have you tried so far?
Waveshare has written their own ST7701 driver, along with their own IO Expander code but it was all written for LVGL 8. The code I had already written used LVGL 9 and I was using a cheaper 240x320 “Cheap Yellow Display” ESP32-WROOM. The biggest issue with that is I had no great way of mounting it into a guitar pedal enclosure with a nice and professional finished look.
So, I came across the Waveshare dev boards because they already have a nice cover glass when you use one of their capacitive touch panels. 2.8” is the perfect size to fit into a standard 1590B or 125B guitar pedal enclosure. The 1590B is a little bit narrower and smaller so we are shooting to make it work with one of those ideally.
My application is that I am building a (potentially open source) chromatic guitar enclosure. I need 3 GPIOs available:
- A GPIO that supports ADC1 because I do continuous reading of the incoming guitar signal. I’ve got a separate PCB that includes a pre-amplifier to make sure the signal from the guitar is nice and strong before it reaches the ESP32. For the Waveshare 2.8B device, they only expose one ADC and it’s GPIO_4 (ADC1_CH3).
- A GPIO for reading the pedal’s momentary foot switch. I’m currently using GPIO_0 which is also convenient for debugging w/o it all connected because I can use the BOOT button on the dev board.
- A GPIO for controlling the external low signal DPDT relay (a TQ2-L2-5V). I’m using GPIO_43 (RXD) and that all works. Waveshare has GPIO 43 and 44 incorrectly swapped for TXD and RXD. Took me a while to figure that one out.
The code supports a few different styles of UI for the tuning interface. None of them I have working very quickly on this new device. I’m guessing it’s because the resolution is so much higher than it was on the ESP32-WROOM device I previously had.
I’ve tried using the ST7701 driver that’s provided by Espressif but haven’t been able to figure that all out yet because of the expanded IO this dev board seems to use.
I think that my general plan is to try to use an approach similar to this: Someone willing to hold my hand? - #12 by kdschlosser
But…if anyone has any suggestions in general, I’m all ears. I feel like I’ve been banging my head against the wall for a few days to make this work.
The stuff that does show up on the screen, however, is extremely crisp and sharp though! I just hope I can speed it up a little bit so you don’t actually see the frames (a sweep from top to bottom of the screen when refreshes happen).
I currently have three different RTOS tasks running…
- A gpio_task on Core 0 that reads the state of the momentary foot switch and dispatches a press/double press/long press to the software
- GUI/LVGL task also running on Core 0
- Pitch Detection task solely running on Core 1 doing continuous reading of the ADC pin
My code is a mess right now because it’s all torn apart but I’ll try to clean it up today and get something posted here.
Screenshot and/or video
Here’s an example of how it’s currently working. I used to have 3 arcs spinning around the note but that was making the fps drop down to about 4fps. I also used to have some fade animation when the note stopped but that was also making the refresh rate slowness extremely apparent.