Creating a driver for a MIPI LCD

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

Creating a driver for a MIPI LCD

12,221 Views
CMoran
Contributor III

I'm working with a MIMXRT1170-EVK board trying to create a driver for a MIPI LCD that is not 1 of the 3 that already have drivers in the SDK. I'm using the MIPI DSI Compliant Test as my project, I've modified the frame buffer in that to display a red, green, blue pattern on the LCD instead of a black, grey, white.

The LCD I'm trying to create a driver for is a Riverdi RVT70HSMNWC00-B, it's LCD driver is an EK79007AD3+EK73217BCGA. The pinouts are not the same between the EVK and the LCD so I have a breakout board so that the clock and data lanes are aligned, along with the 3.3V and GND, the anode and cathode for the LCD backlight is powered by an external DC power supply as the electrical characteristics for the Riverdi backlight are different than the Rocktech backlight.

The LCD is partially receiving commands properly, I'm able to set the LCD to display a Built-In Self Text (BIST) pattern perfectly fine. The BIST pattern doesn't use any of the data lanes or clocks, when I send the commands for the LCD to function in normal operation a bunch of static comes through (it looks like an old CRT tv on the wrong channel). Below I will add the files I've modified, along with the lines specific where I added stuff for my driver. If anyone has any light to shed on this it would be much appreciated, I'm at a loss right now.

The Riverdi LCD datasheet can be found here: https://riverdi.com/download/RVT70HSMNWC00-B/DS_RVT70HSMNWC00-B%20_Rev.1.0.pdf

In display_support.h:

  • Lines 22-23: Added defines for screens.
  • Lines 28-30: Define the panel being used.
  • Lines 73-78: Added width and height of panel.

In display_support.c:

  • Lines 17-19: Added conditional include for the EK97007AD3 controller.
  • Lines 64-73: Defined the panel's timing characteristics (Back/Front Porch, Sync Pulses).
  • Lines 188-206: Created structures for underlying MIPI DSI driver.
  • Lines 311-312: Added divider for desired Pixel Clock Frequency.
  • Lines 398-401: Added initialization of LCD panel.

In fsl_ek79007ad3.h:

  • All of this was created from scratch using the drivers for the other panels as reference.

In fsl_ek79007ad3.c:

  • All of this was created from scratch using the drivers for the other panels as reference.
  • The initialization sequence is taken from the Riverdi initialization code from their datasheet.

Everything else is exactly the same as it is in the evkmimxrt1170_mipi_dsi_compliant_test_cm7 project from the SDK (SDK_2.x_MIMXRT1170-EVK (Version 2.11.1)).

0 Kudos
Reply
8 Replies

1,428 Views
yazan_shhady_123
Contributor I

can you share how you set the panel in the device tree?

0 Kudos
Reply

9,535 Views
myee_
Contributor II

Hi @CMoran , 

I am also having the same issue, but also wanted to read back some registers to confirm they have been written properly. I am curious if you ever used the MIPI_DSI_GenericRead function successfully too?

Although my LCD is different, I am also curious what the 0x87 (Riverdi god code) register might be for, as that register is not in the EK79007ad3 datasheet. My LCD has no mention of other initialization registers like this. 

 

Thanks!!

0 Kudos
Reply

12,216 Views
CMoran
Contributor III

For additional visuals I've taken a video of the panel in BIST mode and under normal operation. I can verify that the panel is receiving some commands correctly as BIST mode is not a default option. Something is just out of sync under normal operation but I don't understand what.

0 Kudos
Reply

10,728 Views
application_ninja
Contributor III

Hi CMoran, did you ever get a solution to this? I'm having the same issues...

0 Kudos
Reply

10,673 Views
CMoran
Contributor III

Yes I did eventually figure out that the issue was the MIPI DSI Tx Esc clock frequency. Here's a snippet of code from the function BOARD_InitMipiDsiClock (in display_support.c) that had to be modified in order for the LCD to display correctly.

    const clock_root_config_t mipiEscClockConfig = {
        .clockOff = false,
        .mux = kCLOCK_MIPI_ESC_ClockRoot_MuxOscRc400M, /*!< 400Mhz. */
        .div = 14,
    };

    CLOCK_SetRootClock(kCLOCK_Root_Mipi_Esc, &mipiEscClockConfig);

    mipiDsiEscClkFreq_Hz = CLOCK_GetRootClockFreq(kCLOCK_Root_Mipi_Esc);

    const clock_group_config_t mipiEscClockGroupConfig = {
        .clockOff = false, .resetDiv = 1, .div0 = 1,
    };

    CLOCK_SetGroupConfig(kCLOCK_Group_MipiDsi, &mipiEscClockGroupConfig);

    mipiDsiTxEscClkFreq_Hz = mipiDsiEscClkFreq_Hz / 2;

 

I'm unsure of your current setup, if you're also using the same LCD panel, etc... but I hope this is able to help!

0 Kudos
Reply

10,670 Views
application_ninja
Contributor III

Yes, thank you, I suspect my issue is related to this setting as well, I just cannot determine how to figure out the correct values for my display. Which is a 1080x1920 @ 30fps...

0 Kudos
Reply

10,660 Views
CMoran
Contributor III

It was a while since I did it, but what ended up happening is somewhere in the EK79007AD3 datasheet it says that the escape clock has to be within a range of the low power clock (66.67% to 150%) and that the low power clock has a requirement of 20ns. So you may have to dive into your LCD's tft driver datasheet. For the pixel clock the formula provided is: 

(height + VSW + VFP + VBP) * (width + HSW + HFP + HBP) * frame rate.

 

0 Kudos
Reply

10,658 Views
application_ninja
Contributor III

OK, thanks... yeah the pixel clock is easy and well documented, the LCD datasheet I have is not, but Ill pour over it again, thanks!

0 Kudos
Reply