iMXRT1064 with LCD

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

iMXRT1064 with LCD

5,592 次查看
anujtanksali
Contributor II

Hi,

Am using iMXRT1064 with 7" LCD and Emwin library. color mode is RGB 565. 

I have a PC simulation where same screen related code is running. I see a difference in colors on my PC simulation application when compared to colors on the LCD with hardware.

Am using emwin library version 5.50 on hardware.

The colors on the hardware look dull compared to the simulation on PC.

Are there any parameters on the iMXRT device i can look into to improve the colors on the LCD.

Or emwin has some settings which can be looked into.

Thanks

Regards,

Anuj

标签 (1)
标记 (1)
0 项奖励
回复
21 回复数

5,424 次查看
jeremyzhou
NXP Employee
NXP Employee
Hi Anuj,
Thanks for your reply.
After comparing the schematic, I find the LCD_data pin connection of the customer board is as same as the MIMXRT1064 board (as below indicates).
So I've no idea why my previous suggestion didn't work for your board, however, it works on the MIMXRT1064 board.
Maybe you can contact the FAE of the LCD panel for help, they may provide some insight into your issue.
Have a great day,
TIC
 
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
 
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
0 项奖励
回复

5,390 次查看
anujtanksali
Contributor II

Hello @jeremyzhou ,

Thanks for the reply.

If possible will check the suggestion on iMXRT1064 board.

Regards,

Anuj

0 项奖励
回复

5,517 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
Before answering your question, I'd like to confirm some inquiries with you.
1) Does the mode you mentioned is the second parameter in GUI_DEVICE_CreateAndLink()?
2) What board do you test? I was wondering if you can share the schematic about the LCD part.
3) Can you share the code of initializing the LCD device?

Looking forward to your reply.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

5,517 次查看
anujtanksali
Contributor II

Hi jeremyzhou‌,

Thanks for your reply.

1) Yes, mode is #define COLOR_CONVERSION GUICC_M565 and the second parameter of GUI_DEVICE_CreateAndLink

2) The board we are using is a prototype board developed from our project and the LCD pin out is similar to iMXRT1064 EVK board.

3) I have used the same code as the Emwin demo but below are the LCD init code snippets.

Just a point to mention that the colors look the same when compared to PC simulation but dull on the hardware.

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

void LCD_X_Config(void)
{
GUI_MULTIBUF_Config(GUI_BUFFERS);
GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);   
LCD_SetSizeEx(0, LCD_WIDTH, LCD_HEIGHT);
LCD_SetVSizeEx(0, LCD_WIDTH, LCD_HEIGHT);
LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR);
#if (LCD_BITS_PER_PIXEL == 8)
LCD_SetLUT(&_aPalette_256);
#endif

//GUI_TOUCH_SetOrientation(GUI_MIRROR_X | GUI_MIRROR_Y);

// Set the LCD orientation.
//GUI_SetOrientation(GUI_MIRROR_X | GUI_MIRROR_Y);
//BOARD_Touch_Init();
}

int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void *p)
{
uint32_t addr;
#if (LCD_BITS_PER_PIXEL == 8)
uint16_t colorR, colorG, colorB;
uint32_t color;
#endif
int result = 0;
LCD_X_SHOWBUFFER_INFO *pData;
switch (Cmd)
{
case LCD_X_INITCONTROLLER:
{
APP_ELCDIF_Init();
break;
}
case LCD_X_SHOWBUFFER:
{
pData = (LCD_X_SHOWBUFFER_INFO *)p;
/* Calculate address of the given buffer */
addr = VRAM_ADDR + VRAM_SIZE * pData->Index;
/* Make the given buffer visible */
ELCDIF_SetNextBufferAddr(APP_ELCDIF, addr);
//
// Remember buffer index to be used by ISR
//
s_LCDpendingBuffer = pData->Index;
while (s_LCDpendingBuffer >= 0)
;
return 0;
}
#if (LCD_BITS_PER_PIXEL == 8)
case LCD_X_SETLUTENTRY:
{
//
// Required for setting a lookup table entry which is passed in the 'Pos' and 'Color' element of p
//
LCD_X_SETLUTENTRY_INFO *pData;
pData = (LCD_X_SETLUTENTRY_INFO *)p;
//
// Call hardware routine to write a LUT entry to the controller
//
color = pData->Color;
colorB = (color & 0xFF0000) >> 16;
colorG = (color & 0x00FF00) >> 8;
colorR = (color & 0x0000FF);
/* 16-bit bus */
lutData[pData->Pos] = ((colorR >> 3) << 11) | ((colorG >> 2) << 5) | ((colorB >> 3) << 0);
return 0;
}
#endif
default:
result = -1;
break;
}

return result;
}

Thanks

Regards,

Anuj

0 项奖励
回复

5,517 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Anuj,

Thanks for your reply.
Please follow the below suggestions to adapt the code.
1) #define COLOR_CONVERSION GUICC_M8888I //GUICC_M565
2) #define ELCDIF_PIXEL_FORMAT kELCDIF_PixelFormatXRGB8888 //kELCDIF_PixelFormatRGB565
Please give a try.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

5,517 次查看
anujtanksali
Contributor II

Hello jeremyzhou‌,

I tired the suggestions but they did not work. Instead of one screen i got to see 4 small screens on the LCD.

Thanks

Regards,

Anuj

0 项奖励
回复

5,516 次查看
jeremyzhou
NXP Employee
NXP Employee
Hi Anuj,
Thanks for your reply.
I was wondering if you can share the schematic about the LCD part. And did you ever try to run the testing demo with the MIMXRT1064 board?
Have a great day,
TIC
 
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
 
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

5,500 次查看
anujtanksali
Contributor II

Hello @jeremyzhou ,

I will check if we can share the schematic for the LCD part.

I will test our screen on the MIMXRT1064 to compare the colors and let you know.

Thanks

Regards

Anuj

 

 

0 项奖励
回复

5,432 次查看
anujtanksali
Contributor II

Hi @jeremyzhou ,

Please see the snapshot of the LCD part from the schematic.

 

LCD_Part.PNG

Thanks

Regards,

Anuj 

 

 

 

0 项奖励
回复

5,369 次查看
anujtanksali
Contributor II

Hi @jeremyzhou ,

I was able to test a sample program on the EVK with the above LCD related suggestions. Please see snapshots below,

With Original LCD settings

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

IMG_20200911_122027.jpg

With suggested changes

#define DISPLAY_DRIVER GUIDRV_LIN_16
#define COLOR_CONVERSION GUICC_M8888I //GUICC_M565
#define ELCDIF_PIXEL_FORMAT kELCDIF_PixelFormatXRGB8888 //kELCDIF_PixelFormatRGB565
#define APP_LCDIF_DATA_BUS kELCDIF_DataBus16Bit

IMG_20200911_124518.jpg

It seems the suggested change does not work on the EVK too.

Thanks

Regards

Anuj

 

0 项奖励
回复

5,361 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thanks for your reply.
The phenomenon seems a bit weird. From your attachments, the LCD panel is different from mine, was it purchased from NXP?

Have a great day,
TIC
 
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
 
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
0 项奖励
回复

5,350 次查看
anujtanksali
Contributor II

Hi @jeremyzhou ,

The LCD panel is not purchased from NXP. 

Regards,

Anuj

 

0 项奖励
回复

5,341 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thanks for your reply.
I‘d like to suggest that you'd better contact the LCD vendor and they may provide some insights into the phenomenon, even share an emwin demo.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

5,335 次查看
anujtanksali
Contributor II

Hello @jeremyzhou ,

Can we please let me know what difference is present in the LCD panel when compared to the snapshots?

Also which panels are you using?

Thanks

Regards,

Anuj

 

 

0 项奖励
回复

5,312 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thanks for your reply.
After discussing with my co-worker, we'd like to suggest following the below steps for testing.
1) Firstly, run the evkmimxrt1064_elcdif_rgb which also comes from the SDK library instead of emwin demo to kick off. Definitely, it needs to adjust this demo to fit your LCD panel, for instance, LCD's size and timing parameters, you can modify the highlighted element via the below struct.
void APP_ELCDIF_Init(void)
{
const elcdif_rgb_mode_config_t config = {
.panelWidth = APP_IMG_WIDTH,
.panelHeight = APP_IMG_HEIGHT,
.hsw = APP_HSW,
.hfp = APP_HFP,
.hbp = APP_HBP,
.vsw = APP_VSW,
.vfp = APP_VFP,
.vbp = APP_VBP,
.polarityFlags = APP_POL_FLAGS,
.bufferAddr = (uint32_t)s_frameBuffer[0],
.pixelFormat = kELCDIF_PixelFormatXRGB8888,
.dataBus = APP_LCDIF_DATA_BUS,
};

#if (defined(APP_ELCDIF_HAS_DISPLAY_INTERFACE) && APP_ELCDIF_HAS_DISPLAY_INTERFACE)
BOARD_InitDisplayInterface();
#endif
ELCDIF_RgbModeInit(APP_ELCDIF, &config);
}
2) After that, you can run the emwin demo, you just do the same modification work as the above steps and I think the LCD will demonstrate well.
Note: You can find the timing parameters in your LCD panel's datasheet.
3) To increase the light of the LCD panel, you should add a Backlight Control circuit for LCD, just as MIMXRT1064 EVK did.

2020-09-16_15-46-25.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

5,244 次查看
anujtanksali
Contributor II

Hi @jeremyzhou ,

I tried out the evkmimxrt1064_elcdif_rgb program as suggested. Initially the program did not compile and was giving error related to NCACHE_REGION memory overflow.

1) I increased the memory settings as below and was able to compile.

Capture6.PNG

2) I ran the program on the MIMX1064 board once with new LCD parameters. 

3) Then programmed the MIMX1064 with Emwin Demo code with sample program to display colors

 see snapshot below

IMG_20200917_165646.jpg

4) I then programmed the MIMX1064 board with my project code and same sample program as above. 

see below snapshot

 

IMG_20200917_170233.jpg

 Both seem similar.

The difference in Emwin demo and my project is bpp. Emwin demo has 32 bpp settings and my project code is 16 bpp settings.

I will try to run my project with 32 bpp setting but it seems i will not make much difference as from the above snapshots both seem similar.

Please let me know what else can i try.

Thanks

Regards,

Anuj

 

 

 

 

 

 

 

0 项奖励
回复

5,240 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thanks for your reply.
For the evkmimxrt1064_elcdif_rgb, from the software perspective, the RGB color space format is RGB888 (Red 8, Green 8, Blue 8), which is organized as a word (32-bit) in memory as (UUUUUUUU RRRRRRRR GGGGGGGG BBBBBBBB) (U = unused).
However, according to EVK's schematic, it doesn't make use of all the 24-bit display data signals but part of them, supporting RGB565 at most, so the RGB color space format would become the 'RGB565'(Red 5, Gnd 3, Green 6, Gnd 2, Blue 5, Gnd 03 ) which is organized as UUUUUUUU RRRRR000 GGGGGG00 BBBBB000 (U = unused).
In another word, the EVK board use the hardware approach converts the color space format from RGB888 into 'RGB565'.
Back to your original question, you can try to adapt the Backlight Control circuit to make it, but you'd better refer to its datasheet prior to doing it.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

5,232 次查看
anujtanksali
Contributor II

Hello @jeremyzhou ,

Yes, i know that RGB888 will be converted to RGB565. 

RGB888 will obviously take up more amount of memory.

Whats the difference then to use RGB565 directly or use RGB888 which is anyway going to be converted to RGB565.

Will using RGB888 be better or RGB565 is fine. we will have to consider this as using RGB888 will take up more memory.

Regarding backlight we have separate backlight control circuit on our board.

Thanks

Regards,

Anuj

 

 

0 项奖励
回复

5,208 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thanks for your reply.
1) What's the difference then to use RGB565 directly or use RGB888 which is anyway going to be converted to RGB565?
-- Comparing to RGB565, the RGB888 has more bits to describe the images which means images are rendered more colorful and real.
2) Will using RGB888 be better or RGB565 is fine. we will have to consider this as using RGB888 will take up more memory.
-- In the evkmimxrt1064_elcdif_rgb demo, the LCD data format is RGB888 actually, however, the LCD can only receive the RGB565 because of the limation of the hardware circuit, just I mentioned before.
Hope this is clear.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 项奖励
回复

5,204 次查看
anujtanksali
Contributor II

Hi @jeremyzhou ,

So our case as the lines are 16 then RGB565 will work fine. So no need to use RGB888 then.

My question was what's the use of RGB888 if lines are only 16. Is their any advantage in this case?

Thanks

Regards

Anuj

 

0 项奖励
回复