optimize LoBo TFT access...

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
jedie
Posts: 247
Joined: Fri Jan 29, 2016 12:32 pm
Contact:

optimize LoBo TFT access...

Post by jedie » Fri Oct 19, 2018 5:55 pm

I made a minimalistic mandelbrot rendering on ODROID GO:

https://gist.github.com/jedie/6d68e033a ... 8aa7ea46f0

How to optimize this?!?

I call tft.pixel(x, y, color) ... so every pixel are always show immediately.
How to put a complete line into a buffer?

OutoftheBOTS_
Posts: 791
Joined: Mon Nov 20, 2017 10:18 am

Re: optimize LoBo TFT access...

Post by OutoftheBOTS_ » Fri Oct 19, 2018 8:19 pm

I did put in a feature request to Lobo to add that I can write a buffer from RAM to the screen window but as far as I am aware this hasn't been implemented.

It is probably possible to use the low level methods as a work around.

Code: Select all

tft.tft_writecmddata(cmd, data)
if you used Memory Write (2Ch) as cmd and then had a bytearray with your pixel data as the data

i.e something like this

Code: Select all

#create a bytearray to hold 1 line (320 pixels * 2 bytes per pixel) of pixel data
data = bytearray(320 *2)

#add code to fill the bytearray with the needed data

#send the data to the screen RAM
tft.tft_writecmddata(0x2C, data)

loboris
Posts: 320
Joined: Fri Oct 02, 2015 6:19 pm

Re: optimize LoBo TFT access...

Post by loboris » Fri Oct 19, 2018 9:38 pm

OutoftheBOTS_ wrote:
Fri Oct 19, 2018 8:19 pm
I did put in a feature request to Lobo to add that I can write a buffer from RAM to the screen window but as far as I am aware this hasn't been implemented.
I didn't forget about it, it is in my work queue (which. I'm afraid, is not of a FIFO type).

OutoftheBOTS_
Posts: 791
Joined: Mon Nov 20, 2017 10:18 am

Re: optimize LoBo TFT access...

Post by OutoftheBOTS_ » Fri Oct 19, 2018 10:15 pm

loboris wrote:
Fri Oct 19, 2018 9:38 pm
OutoftheBOTS_ wrote:
Fri Oct 19, 2018 8:19 pm
I did put in a feature request to Lobo to add that I can write a buffer from RAM to the screen window but as far as I am aware this hasn't been implemented.
I didn't forget about it, it is in my work queue (which. I'm afraid, is not of a FIFO type).
Lobo if I used the above work around that I mentioned would this use DMA to transfer the bytearray??

loboris
Posts: 320
Joined: Fri Oct 02, 2015 6:19 pm

Re: optimize LoBo TFT access...

Post by loboris » Fri Oct 19, 2018 10:49 pm

OutoftheBOTS_ wrote:
Fri Oct 19, 2018 10:15 pm
Lobo if I used the above work around that I mentioned would this use DMA to transfer the bytearray??
tft.tft_writecmddata() does not use DMA for transfer. But it uses a very efficient routine, writing directly to SPI hardware and the transfer speed is practically the same as with DMA.
In case the buffer is in in external SPI-RAM (psRAM), it can be even faster, as DMA cannot transfer from external RAM, and data has to be coiped into internal RAM.

Post Reply