Need sample code for ILI9488 LCD on SPI Interface

Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Thu Apr 27, 2017 5:08 pm

loboris wrote:To clear the screen you have to send 320*480*3*8 = 3686400 bits to the display.
At 40 MHz spi clock (1 bit time is 25 ns) the theoretical minimum time is 92.16 ms.
With some optimization I've got 160 ms for clear screen function, I don't think you can get much faster clear screen with any driver on any microcontroller.

Code: Select all

-------------
 Disp clock = 40.00 MHz (requested: 40.00)
      Lines =  1574  ms (320 lines of 480 pixels)
     Pixels =  1757  ms (480x320)
        Cls =   160  ms (480x320)
-------------
Some optimization can still be made for other functions.
In pixel writing functions color values are converted from 16-bit RGB565 to 24-bit values, which take some time. If you use 3-byte RGB color values as a base for display functions, write time can be improved.

I have the complete set of optimized graphics functions (drawing, fonts, images etc) implemented as part of Lua-RTOS-ESP32 project.
Look at https://github.com/loboris/Lua-RTOS-ESP ... les/screen.
Video: https://www.youtube.com/watch?v=esOO3fN1xDw
You can easily extract needed functions to use in any project. If I find some time, I'll make it independent library to use with esp-idf.

Reading from display RAM does not work on my display (returns all zeroes).
You can check if it is working on yours by setting #define DISPLAY_READ 1 in spi_master_demo.c.
You can also uncomment the lines

Code: Select all

		/*
		for (int i=25; i<48; i+=3) {
			printf("[%02x,%02x,%02x] ",rbuf[i],rbuf[i+1],rbuf[i+2]);
		}
		printf("\r\n");
		*/
in disp_spi_read_data function in tftfunc.c to get first 16 color values read printed on screen.
Thanks for valuable reply.

I will check Display Read macro in my LCD and also will look font related examples.

Actually, My requirement is to display some menu inside whole window and can be move from up menu to down menu using Button. Also, There are some page which can accessed using right and left button.

So, Main focus for us is now to display some text and highlight one line text and then move to next line based on arrow key press event.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Thu Apr 27, 2017 5:20 pm

Hi,

If possible then provide me sample examples to draw some fonts over LCD using your current No DMA SPI Interface driver. Then, I will create whole GUI according to project requirement.
Regards,
Ritesh Prajapati

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby loboris » Thu Apr 27, 2017 10:49 pm

TFT drawing and text/fonts library (tft.c, tft.h) is now added to the https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE
My full library includes also image functions (raw image, BMP & JPG), but they requires file system and are not included in this example.

Image

Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Fri Apr 28, 2017 1:04 am

loboris wrote:TFT drawing and text/fonts library (tft.c, tft.h) is now added to the https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE
My full library includes also image functions (raw image, BMP & JPG), but they requires file system and are not included in this example.

Image
Hi,

Thanks for quick update.

Right now, it is ok if some text will be displayed on LCD. Initial goal is to display some text into line over LCD and it will be refreshed based on button event.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Fri Apr 28, 2017 1:58 am

Hi Loboris,

Are you trying to display image file on LCD in you no DMA SPI Master driver?

For that you need SPIFFS file system or other file system support for ESP32.

Let me know if you have any plan for that.
Regards,
Ritesh Prajapati

ESP_igrr
Posts: 1521
Joined: Tue Dec 01, 2015 8:37 am

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby ESP_igrr » Fri Apr 28, 2017 4:29 am


Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Fri Apr 28, 2017 1:05 pm

Hi Loboris,

We have successfully ported your updated SPI No DMA example on ESP32 Development Kit without any issue. Right now, We are focusing to enhance your base code as per our requirement.

So, I have following queries or requirements to expand your base project.

1) To draw whole image or image data which is stored into char buffer.
2) To Print Any character on any X and Y Position on LCD as right now we can not print character on any location instead of bounded location using LEFT, CENTER or RIGHT.
3) Need support to draw half circle on LCD.
4) Need support to draw Arc on LCD as not able to draw Arc on any location.

Let me know if need any informations from my side or any doubt from above requirements.
Regards,
Ritesh Prajapati

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby loboris » Fri Apr 28, 2017 8:45 pm

  • JPG image decoding and drawing on screen is now added. In example the image is drawn from embeded buffer (4 images included), but drawing from file is also supported. I will also include the BMP image support.
  • You can print any text on any x,y location on the screen as demonstrated in the example. The text can also be printed rotated at any angle (except for 7-segment font). Transparent or opaque printing is supported.
  • Drawing n/4 of the circle/elipse is supported
  • Drawing arcs is supported, maybe I forgot to include it in the driver, I'll check it.
  • Reading from display GRAM now works.
I'll include the full description of all functions soon.

Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Sat Apr 29, 2017 1:18 am

loboris wrote:
  • JPG image decoding and drawing on screen is now added. In example the image is drawn from embeded buffer (4 images included), but drawing from file is also supported. I will also include the BMP image support.
  • You can print any text on any x,y location on the screen as demonstrated in the example. The text can also be printed rotated at any angle (except for 7-segment font). Transparent or opaque printing is supported.
  • Drawing n/4 of the circle/elipse is supported
  • Drawing arcs is supported, maybe I forgot to include it in the driver, I'll check it.
  • Reading from display GRAM now works.
I'll include the full description of all functions soon.
Ok. Thanks for Reply.

I will check and let you know need any help from your side.

We have tried to print character on any x,y location but not got any success still I will check again it.

Also, n/4 circle and arc are already supported or added recently as we are not able to draw it on particular location still I will check it that stuffs as well again.

Can you please share your email ID or Skype ID if you are using Skype which will become fast communication way to discuss all this stuff as quickly as possible if you don't mind it?

Let me now if you are expanding your example by your own thinking as well.
Regards,
Ritesh Prajapati

Ritesh
Posts: 1095
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Sat Apr 29, 2017 1:28 pm

Hi Loboris,

We have checked your updated repository with all 4 images which you have provided with source code. It works fine but we have one concern regarding image display functionality as we have seen some while dots on the image while it is displaying on ILI LCD9488.

So, Have you observer this type of issue or behavior while testing same code on your ILI LCD 9488?

Is it related to graphic LCD or issue of ESP32 Development Kit on which i am running your code right now?

Also, we have seen some flickering issue while objects are moving on screen.

Let me know if you have any idea for that.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Baidu [Spider] and 20 guests