eLCDIF for 800x480 LCD questions AN12302

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

eLCDIF for 800x480 LCD questions AN12302

跳至解决方案
794 次查看
_bjs
Contributor III

Hello i am in need of help with the clock framerate calculations for 60Hz/30Hz and 10Hz.

following the https://www.nxp.com/docs/en/application-note/AN12302.pdf guide to set up custom resolution. I have the following parameters, the screen is working with these settings:

#define APP_IMG_HEIGHT 480
#define APP_IMG_WIDTH 800
#define APP_HSW 1 // HSync signal width
#define APP_HFP 210 // Horizontal front porch
#define APP_HBP 46 // Horizontal back porch
#define APP_VSW 1 // VSync signal width
#define APP_VFP 22 // Vertical front porch
#define APP_VBP 23 // Vertical back porch

#define LCD_WIDTH           800
#define LCD_HEIGHT          480
#define LCD_BITS_PER_PIXEL  16
#define LCD_BYTES_PER_PIXEL (LCD_BITS_PER_PIXEL / 8)

#define DISPLAY_DRIVER      GUIDRV_LIN_16
#define COLOR_CONVERSION    GUICC_565
#define ELCDIF_PIXEL_FORMAT kELCDIF_PixelFormatRGB565
#define APP_LCDIF_DATA_BUS  kELCDIF_DataBus16Bit


I am testing using the EVKBIMXRT1050-EmWin_Slide_Show demo.

In the BOARD_InitLcdifPixelClock function, i can set the desired frame rate. I have the values:
(800 + 1 + 210 + 46 ) * (480 + 1 + 22 + 23) * 60 = 33.358.920
(800 + 1 + 210 + 46 ) * (480 + 1 + 22 + 23) * 30 = 16.679.460
(800 + 1 + 210 + 46 ) * (480 + 1 + 22 + 23) * 10 =   5.559.820

how do i convert it into the following?
For 60Hz i have chosen loopDevider as 69, and for postDevider as 5.
How do i get the CLOCK_SetMux and CLOCK_SetDive values?

    /*
     * Initialize the Video PLL.
     * Video PLL output clock is OSC24M * (loopDivider + (denominator / numerator)) / postDivider = 93MHz.
     */
    clock_video_pll_config_t config = {
        .loopDivider = 31,
        .postDivider = 8,
        .numerator   = 0,
        .denominator = 0,
    };

    CLOCK_InitVideoPll(&config);

    /*
     * 000 derive clock from PLL2
     * 001 derive clock from PLL3 PFD3
     * 010 derive clock from PLL5
     * 011 derive clock from PLL2 PFD0
     * 100 derive clock from PLL2 PFD1
     * 101 derive clock from PLL3 PFD1
     */
    CLOCK_SetMux(kCLOCK_LcdifPreMux, 2);

    CLOCK_SetDiv(kCLOCK_LcdifPreDiv, 4);

    CLOCK_SetDiv(kCLOCK_LcdifDiv, 1);

 

Where can i find this MIMXRT1052xxxxx_sdram.icf, or similar for EMWIN slide show demo?

For the AN12302 example there is a line saying set APP_ELCDIF->CTRL2 = 0x00700000;
Can i use this value ? What value do i set it? 


Thank you in advance!

0 项奖励
回复
1 解答
789 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi  @_bjs ,

You can try MCUxpresso Config Tools. When you change the settings, the function parameter also will change. And the line number will show in purple.

jingpan_0-1657689598132.png

 

.icf file is IAR link file. In emWin project, it only has MIMXRT1052xxxxx_flexspi_nor_sdram.icf. You can find more in other demo project in SDK, for example in SDK_2_10_0_EVKB-IMXRT1050\boards\evkbimxrt1050\demo_apps\hello_world\iar

Yes, you can set this value. The LCDIF_CTRL2[OUTSTANDING_REQS] bitfield will control how many
requests the eLCDIF can have in flight on any given clock cycle. This should be programmed based on the expected system bus latency for returned read data.

 

Regards,

Jing

在原帖中查看解决方案

0 项奖励
回复
3 回复数
790 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi  @_bjs ,

You can try MCUxpresso Config Tools. When you change the settings, the function parameter also will change. And the line number will show in purple.

jingpan_0-1657689598132.png

 

.icf file is IAR link file. In emWin project, it only has MIMXRT1052xxxxx_flexspi_nor_sdram.icf. You can find more in other demo project in SDK, for example in SDK_2_10_0_EVKB-IMXRT1050\boards\evkbimxrt1050\demo_apps\hello_world\iar

Yes, you can set this value. The LCDIF_CTRL2[OUTSTANDING_REQS] bitfield will control how many
requests the eLCDIF can have in flight on any given clock cycle. This should be programmed based on the expected system bus latency for returned read data.

 

Regards,

Jing

0 项奖励
回复
769 次查看
_bjs
Contributor III

Hello Jing,

I have tried this solution, but it is incorrect.
The clock config and clock diagram do not result in the same configuration as the hardcoded overwrite configuration:

In the temperature control EMWIN example there is the following hardcoded:

     * Here set the LCDIF pixel clock to 9.3M.

    clock_video_pll_config_t config = {
        .loopDivider = 31,
        .postDivider = 8,
        .numerator   = 0,
        .denominator = 0,
    };

    CLOCK_InitVideoPll(&config);

    CLOCK_SetMux(kCLOCK_LcdifPreMux, 2);
    CLOCK_SetDiv(kCLOCK_LcdifPreDiv, 4);
    CLOCK_SetDiv(kCLOCK_LcdifDiv, 1);

 

When i try to copy this into the clock configurator the MCUXpresso IDE does not even let me change the DENOM from 1 to 0.

When i place the value 9.3 Mhz I get totally different values for the LCD pixel clock settings. 

Please help i am not understanding, The screen is buggy and i cannot use it.

 

0 项奖励
回复
753 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi @_bjs ,

Sorry I doesn't understand what you want to do. Did you try the config tool?

 

Regards,

Jing

0 项奖励
回复