Quote:
Originally Posted by SLOPOS
Very familiar with that platform, granted when I was using them they were mostly used for WiFi gpio to control relays and the like, but not much else. Im guessing then you're using i2c for the screen output which wouldn't even require going to a pi as there are plenty of larger i2c screens available and the resolution and refresh rates seem to be adequate. More and more impressed with this project the more I learn about it, thanks for sharing!
|
I think you meant SPI, not I2C... I2C is too slow for a full colour display.
A 320 x 240 display has 76,800 pixels, and each pixel has 16 bits (RGB565) of colour information, for a total of 1,226,800 pixels or 153,600 bytes per LCD screen/page.
The LCD controller I use supports a max SPI clock of 40 Mhz resulting in taking 0.180 seconds to draw each page. By only "drawing" the parts of the screen that change, the display updates around 30 times per second.
To make the best use of all clock cycles, I use a RTOS (real time operating system) which allows pre-emptive multitasking. This allows me to run multiple tasks at the same time.
The tasks I have set up are: reading the CAN bus, receiving Bluetooth data, and drawing the display. They all run independently and at full speed. Nice!
Also, since the ESP32 has 2 cores, core 0 is dedicated to handling all Bluetooth communications, and core 1 handles reading the CAN bus and rendering the display.
Anyways, I'm glad to share the details...