03-16-2022, 10:35 AM
|
#23 (permalink)
|
Base Member
Join Date: Dec 2021
Location: Florida
Posts: 54
Drives: 2013 370z Base MT
Rep Power: 5822
|
Quote:
Originally Posted by MotorvateDIY
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...
|
Oh, derp! I was thinking esp8266 which didn't have spi capabilities *facepalm* - kinda the little brother of the esp32. I do think I have some 32s laying around from a weather station project I was working on but never finished. Can't wait to see the full published doc - if you need any 370 guinea pigs, feel free to drop be a line.
|
|
|