Need sample code for ILI9488 LCD on SPI Interface

Ritesh
Posts: 1383
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 22, 2017 11:07 am

loboris wrote:
Ritesh wrote:Anyone has any update on this?
I have one ILI9488 based LCD Display module and will test it this weekend or early next week...
Have you checked ILI9488 based LCD using SPI Master Example? Let me know once you check and get success into it.
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 » Sat Apr 22, 2017 8:31 pm

Ritesh wrote:Have you checked ILI9488 based LCD using SPI Master Example? Let me know once you check and get success into it.
I'm working on it, but I don't have much free time at the moment.
Apart from different init sequence, ILI9488 require 3 byte per color pixel...
You can look at some Arduino library and try to port it yourself. Good example is https://github.com/jaretburkett/ILI9488.
When I finish it, it will be available on my GitGub repository https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE
Please be patient.
Ritesh wrote:I have also checked SPI Clock which is not getting proper after running above example as set 500 KHz, 1 MHz, 10 MHz.
ILI9341 can work with spi clock up to 40MHz (tested for 8h working without errors). I'll test ILI9488 max speed and report it here.

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

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Mon Apr 24, 2017 12:52 am

loboris wrote:
Ritesh wrote:Have you checked ILI9488 based LCD using SPI Master Example? Let me know once you check and get success into it.
I'm working on it, but I don't have much free time at the moment.
Apart from different init sequence, ILI9488 require 3 byte per color pixel...
You can look at some Arduino library and try to port it yourself. Good example is https://github.com/jaretburkett/ILI9488.
When I finish it, it will be available on my GitGub repository https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE
Please be patient.
Ritesh wrote:I have also checked SPI Clock which is not getting proper after running above example as set 500 KHz, 1 MHz, 10 MHz.
ILI9341 can work with spi clock up to 40MHz (tested for 8h working without errors). I'll test ILI9488 max speed and report it here.
Thanks for quick reply..

I think it will support up to 80 MHz.correct?

Also what should be proper SPI mode. It's mode 0 or other?

Also, I will first try with other board to verify that LCD is working properly or not.

Let me know if you find any update for ILI9488
Regards,
Ritesh Prajapati

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

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Tue Apr 25, 2017 10:26 am

loboris wrote:
Ritesh wrote:Have you checked ILI9488 based LCD using SPI Master Example? Let me know once you check and get success into it.
I'm working on it, but I don't have much free time at the moment.
Apart from different init sequence, ILI9488 require 3 byte per color pixel...
You can look at some Arduino library and try to port it yourself. Good example is https://github.com/jaretburkett/ILI9488.
When I finish it, it will be available on my GitGub repository https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE
Please be patient.
Ritesh wrote:I have also checked SPI Clock which is not getting proper after running above example as set 500 KHz, 1 MHz, 10 MHz.
ILI9341 can work with spi clock up to 40MHz (tested for 8h working without errors). I'll test ILI9488 max speed and report it here.
Have you checked on ILI9488 LCD with your Non DMA example?

Also, you have checked into ILI9341 LCD using 4 Wire SPI Interface. correct?
Regards,
Ritesh Prajapati

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

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Tue Apr 25, 2017 5:07 pm

Hi loboris,

I have checked your SPI non DMA source code into ILI9488 LCD into ESP32 but not got any success yet.

We just observed initial some colored lines over LCD while LCD was going to initialize. But, After that there is no any effect over LCD.

I have checked using SPI Master example and effect remains same. Also, checked all MISO lines over CLI which are work fine without any issue.

We have also tried with different Arduino code but still not getting any success yet. We are using 4 wire LCD SPI interface.

Let me know if any idea or clue for this non working stuffs which we are facing now.
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 » Tue Apr 25, 2017 7:05 pm

I've had ILI9488 working on STM32F4. Still no time to check it on ESP32.
Basically, all you have to do is make shure the initialization sequence is correct (always include soft reset (0x01) as the first command + delay 100 ms) and replace in every function which sends 16-bit color (RGB565) with 3-byte color (RGB 6-6-6).
I'll try to test it this week.
Have you checked https://github.com/jaretburkett/ILI9488, it's a good starting point.

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

Re: Need sample code for ILI9488 LCD on SPI Interface

Postby Ritesh » Wed Apr 26, 2017 1:58 am

loboris wrote:I've had ILI9488 working on STM32F4. Still no time to check it on ESP32.
Basically, all you have to do is make shure the initialization sequence is correct (always include soft reset (0x01) as the first command + delay 100 ms) and replace in every function which sends 16-bit color (RGB565) with 3-byte color (RGB 6-6-6).
I'll try to test it this week.
Have you checked https://github.com/jaretburkett/ILI9488, it's a good starting point.
Can you please share code example for STM32F4?

So, That we have also STM32 boards and will check LCD with that.

Please share code example ASAP
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 » Wed Apr 26, 2017 3:39 pm

@Ritesh

I have tested ILI9488 based display (http://www.buydisplay.com/default/lcd-3 ... kout-board) with ESP32 (SparkFun ESP32 Thing) and it is working with my non-dma spi driver.
GitHub repository is updated with fully working example for ILI9488.
Works with spi clocks up to 40MHz.
Read from display RAM doesn not work at the moment, I'll check it later

Please check at https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE.

Image

Ritesh
Posts: 1383
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 8:11 am

loboris wrote:@Ritesh

I have tested ILI9488 based display (http://www.buydisplay.com/default/lcd-3 ... kout-board) with ESP32 (SparkFun ESP32 Thing) and it is working with my non-dma spi driver.
GitHub repository is updated with fully working example for ILI9488.
Works with spi clocks up to 40MHz.
Read from display RAM doesn not work at the moment, I'll check it later

Please check at https://github.com/loboris/ESP32_SPI_MA ... MA_EXAMPLE.

Image
Thanks for update into NODMA driver.

I have checked your driver with some modifications like SPI Pin configurations and its working fine without any issue. But, Right Now, Some boxes, random colored window, patterned color patterned and few other window are coming after running that example,

So, As you told that " display RAM" is not working. so does it related to speed point of view. Also, I have checked Arduino based ILI9488 example in which it seems to be faster even in 8 MHz SPI clock because ESP32 is running on 240 MHz and maximum SPI clock supported is 40 MHz.

So, that is my concern regarding your NoDMA driver as you told that it is 10 times faster than actual spi_master driver.

Please find following output which i got after executing your example.
-------------
Disp clock = 6.15 MHz (requested: 6.00)
Lines = 2089 ms (320 lines of 480 pixels)
Pixels = 4974 ms (480x320)
Cls = 704 ms (480x320)
-------------
-------------
Disp clock = 8.00 MHz (requested: 8.00)
Lines = 1948 ms (320 lines of 480 pixels)
Pixels = 4096 ms (480x320)
Cls = 563 ms (480x320)
-------------
-------------
Disp clock = 16.00 MHz (requested: 16.00)
Lines = 1712 ms (320 lines of 480 pixels)
Pixels = 2633 ms (480x320)
Cls = 331 ms (480x320)
-------------
-------------
Disp clock = 20.00 MHz (requested: 20.00)
Lines = 1665 ms (320 lines of 480 pixels)
Pixels = 2337 ms (480x320)
Cls = 284 ms (480x320)
-------------
-------------
Disp clock = 26.67 MHz (requested: 24.00)
Lines = 1618 ms (320 lines of 480 pixels)
Pixels = 2053 ms (480x320)
Cls = 237 ms (480x320)
-------------
-------------
Disp clock = 40.00 MHz (requested: 40.00)
Lines = 1571 ms (320 lines of 480 pixels)
Pixels = 1757 ms (480x320)
Cls = 191 ms (480x320)
-------------
Also, is there any plan to display words and digits on LCD in your examples?

Let me know once you update your example. Again thanks for your support.
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 9:42 am

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.

Who is online

Users browsing this forum: No registered users and 146 guests