2024-10-24 04:29 AM
Hi,
I am using the STM32H563 with an ST7735S display and encountering a colour difference between TouchGFX and the display. How can this issue be resolved?
Thanks
Mathan
Solved! Go to Solution.
2024-11-05 05:49 AM
To fix this colour issue
Thanks
Mathan
2024-11-05 05:53 AM
I think that you should keep the 8 bits SPI interface but I assume there is a problem in the way you set the color format.
Maybe you set it as RGB565 somewhere and RGB888 somewhere else, maybe you have the wrong format in your screen's driver, etc.
I cannot help you much because you have a custom board so I do not know what you have done, I need more information, that is why I redirected you to our guides for color format.
Regards,
2024-11-05 05:58 AM
what information do you want? I will share you.
2024-11-05 06:40 AM
2024-11-06 02:19 AM
Hi Gaetan Godart,
Here are the result
Can you check in your driver the color format of the pixels?
0x05: 16-bit colour depth (5 bits for red, 6 bits for green, 5 bits for blue).
FYI:
I previously encountered a colour issue with the ST7735 driver before integrating TouchGFX. Therefore, I converted the colour's hexadecimal value as follows.
#define RGB565_TO_BGR565(rgb) ((((rgb) & 0x001F) << 11) | ((rgb) & 0x07E0) | (((rgb) & 0xF800) >> 11))
#define RED RGB565_TO_BGR565(0xF800)
#define GREEN RGB565_TO_BGR565(0x07E0)
#define BLUE RGB565_TO_BGR565(0x001F)
Thanks
Mathan
2024-11-07 02:14 AM
Hello @Mathan Raja ,
Thank you for the extra information.
In TouchGFX, the red and blue are clearly swapped. I don't know about before integrating TouchGFX.
What happens if you remove the change you made to fix it before integrating TouchGFX?
If you only use TouchGFX to control your display, this could work.
There is also a squiggly red horizontal line through the display that is not straight and of various shades.
Is it a pen drawing? This looks like nothing I have seen before as it is not straight
If it is not a pen drawing on top of the screen, could you try to set all the pixels to a single color without using TouchGFX, so before TouchGFX starts for instance (let's use green for safety :face_with_tears_of_joy:).
You could also use a logic analyzer to check if all the pixels' color were indeed sent as green.
Finally, you could try on another screen to see if the issue persists.
Also, weird thing, but the squiggly line is blue when you set the screen to blue (red in TouchGFX).
Regards,
2024-11-08 12:27 AM
Hi Gaetan Godart,
What happens if you remove the change you made to fix it before integrating TouchGFX?
The issue remains the same.
Is it a pen drawing?
yes, it is a pen drawing.
Thanks
Mathan
2024-11-08 08:28 AM
How to fix this issue?
2024-11-10 05:45 AM - edited 2024-11-10 05:46 AM
The ST7735 has a register called MADCTL (Memory Access Data Control), address 0x36. Notice that one of the bitfields is the RGB/BGR Order. You could try toggling this bit, which will tell the driver to interpret the red and blue channels opposite to what they currently are now.
In your project file drv_st7735.c, check the DRV_ST7735_SetRotation function. Notice that some pre-processor "if" sections set the madctl variable to the ST7735_MADCTL_RGB define and some others set it to ST7735_MADCTL_BGR.
Try swapping the ST7735_MADCTL_RGB with ST7735_MADCTL_BGR and vice versa for all rotation cases.
2024-11-11 01:30 AM
Hello @Mathan Raja ,
What happens if you remove the change you made to fix it before integrating TouchGFX?
Tell me what happens when you try @Michael K 's solution.
Regards,