ILI9341 SPI Display driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ILI9341 SPI Display driver

301 Views
Arjun2
Contributor II

I'm using a ILI9341 TFT display with S32K146EVB-Q144 board.
I tried to use the LCD_TFT project in the S32K cookbook.
I verified in Solace that SPI data is being transmitted but the data is not being displayed on the display. The display just turns ON.

I tested the display with an STM controller, and it was working fine.


How can I solve this issue? 

0 Kudos
Reply
7 Replies

268 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Arjun2

The LCD & TOUCH TFT Shield Display project from the S32K cookbook is based in the STMPE610. If you need to use the ILI9341 screen instead, you will need to port over the library or required commands for that device.

The functions for the STMPE610 touchscreen can be found in the STMPE610.c file.

Best regards,
Julián

 

251 Views
Arjun2
Contributor II
Hi Julián,
Yes, I need to use just the ILI9341 display, I don't want the touch screen capability of the STMPE610.

In TFT_LCD.c , the initializations and filling the screen and drawing anything on the screen, all that kind of functions related to the ILI9341 display are here.
That is what I understand.
0 Kudos
Reply

214 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Arjun2,

I understand you are using functions related to the ILI9341 display, but this device is a third party, which is out of scope for this community's support.

You can use the STMPE610 driver code as reference and search for the ILI9341 driver library to implement instead. I do not think the driver will work directly with your display, as the commands may not be the same.

Best regards,
Julián

180 Views
Arjun2
Contributor II
Hi Julián,
Thank you for the response.

I have a few doubts, I hope you will answer all of them. It might sound stupid from my part, but you know I'm just trying to learn.

If I take the LPSPI example code.
Add the necessary functions to send the commands and data for the ILI9341.
Will it work?

In the case I need to add a software delay precise to milliseconds. How can I add that to the same project?

Or should I create a project, add an OSIF component so that I can get precise delay.
Then add the LPSPI code from the example project and Display codes to this project?
In this case should I add LPSPI component, or can I just copy the SPI code from the example project?
0 Kudos
Reply

151 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Arjun2,

Add the necessary functions to send the commands and data for the ILI9341.
Will it work?

Yes. There should be no reason why this would not work. Just make sure to send the same commands. You can compare the data frame with the STM controller you mentioned previously.

In the case I need to add a software delay precise to milliseconds. How can I add that to the same project?

The simplest solution is to add a delay function. There are some community posts sharing how to do this. For example: Help:Delay Function for time delay(S32K144) - NXP Community or Solved: Delay function using OSIF - NXP Community.

Or should I create a project, add an OSIF component so that I can get precise delay.
Then add the LPSPI code from the example project and Display codes to this project?
In this case should I add LPSPI component, or can I just copy the SPI code from the example project?

That would also work. I would go with the easiest option for you. I think taking the LPSPI example and adding OSIF component is the simplest solution, but you can implement it however you want.

If you create an OSIF project firstly, you must also add the LPSPI component and the source code for it to work.

Best regards,
Julián

Best 

 

128 Views
Arjun2
Contributor II
Hi @Julián_AragónM

So, I have a display library for the ILI9341 display for an STM32 controller and it's working fine.
I ported it to the LCD_TFT example in the cookbook. SPI data and commands are being transmitted but I'm not able to control the display.
So, I ported the same library to a LPSPI example project, there also same thing.

What I observed was there is a delay function in the STM32 library that seems to be missing in NXP side. I tried to add it but just creating a loop to wait there for some time but failed at that.
In order to add the delay function, I came to know about the delay function in OSIF model.
I tried adding it to the example projects, but I was not able to add any components I don't know why. So, I added it to a project I created in which I was able to add components, but the delay was getting stuck in the " while (delta < delay_ticks) " in the "OSIF_TimeDelay" function. I tried the community and tried to fix it but I was not able to.

I think this pretty much sums up what all I have tried on this project.

So, If I take the example LPSPI code or the LCD_TFT code, add the display code to one of these codes. What would you suggest I do to add a precise millisecond delay to the code?
Can I add a component to an example project? which I tried but failed maybe because of my lack of knowledge.

Anyways thank you for the responses.
0 Kudos
Reply

90 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Arjun2,

Is it possible to compare the frame signal from both the S32K1 and the STM32? Either with an oscillator or logic analyser. This way we can confirm the same data is being sent.

If OSIF implementation is not working, you could try to add clk delays within the SPI driver, you may need to read how the SPI delay works, but there are some existing community posts talking about this feature:

Best regards,
Julián

0 Kudos
Reply