cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing the speed of LCD

JCHRI.1
Associate II

I have interfaced an Arduino 2.4" 320x240 LCD display with an ILI9341 controller to an STM32L476 MCU. To do this I stitched together the ST initialization code derived from MX plus some LCD initialization code from LCDwiki plus a font library from Texas Inst. I replaced the SPI driver in the TI part of the code with a native ST driver and it all works well. BUT it is slow. It takes 1.6 sec to write the entire 60,000 pixels because the message is going out one byte at a time with a 12 usec latency between each byte. (two bytes/pixel)

 The HAL driver HAL_SPI_Transmit(&SpiHandle, (uint8_t*)aTxBuffer, 50, 5000) works well, with no latency, when transmitting a string but the TI font interpreter generates only one byte at a time so.. where do I go from here? I suppose I could create a 120 kbyte buffer in RAM and call the above HAL function but I think that's kind of brute force. Any suggestions would be gratefully appreciated.

5 REPLIES 5
MM..1
Chief III

TouchGFX?

>>.. when transmitting a string but the TI font interpreter generates only one byte at a time so.. where do I go from here?

Refactor the code or buffer it so it's more efficient or generates longer runs of data.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JCHRI.1
Associate II

Tesla--

That seems to be the answer doesn't it. I was hoping for a magic fix to eliminate the latency since I don't know where it's coming from. Refactoring the TI code sounds like about a week of work. Thanks-Jim

TDK
Guru

The usual method is to create a screen buffer in memory that can be sent out quickly over SPI using DMA, then make your modification to this buffer. Creating two buffers allows you to ensure changes to the display take place all at once.

No doubt TouchGFX could be used here if you want to look into it.

If you feel a post has answered your question, please click "Accept as Solution".
JCHRI.1
Associate II

Thank you TDK. I think the buffer approach is good but it's going to require a bit of experimenting. I'll look into TouchGFX also