2025-05-14 7:21 AM - edited 2025-05-14 7:23 AM
All control signals seem to be good: `DEN`, `VSYNC`, `HSYNC`, `CLK`. but pixel signals (R0 ~ R7, G0 ~ G7, B0 ~ B7) are always low.
1) DEN.
2) HSYNC.
3) VSYNC.
4) CLK
although control signals correctly work, no pixel data lanes do not.
Code that generated by CubeIDE: (this can show my configuration well than CubeIDE screenshot I think)
LTDC_LayerCfgTypeDef pLayerCfg = {0};
/* USER CODE BEGIN LTDC_Init 1 */
/* USER CODE END LTDC_Init 1 */
hltdc.Instance = LTDC;
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
hltdc.Init.HorizontalSync = 7;
hltdc.Init.VerticalSync = 7;
hltdc.Init.AccumulatedHBP = 15;
hltdc.Init.AccumulatedVBP = 20;
hltdc.Init.AccumulatedActiveW = 335;
hltdc.Init.AccumulatedActiveH = 260;
hltdc.Init.TotalWidth = 391;
hltdc.Init.TotalHeigh = 268;
hltdc.Init.Backcolor.Blue = 0x00;
hltdc.Init.Backcolor.Green = 0x00;
hltdc.Init.Backcolor.Red = 0x00;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 320;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 240;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB888;
pLayerCfg.Alpha = 0;
pLayerCfg.Alpha0 = 0xFF;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg.FBStartAdress = 0;
pLayerCfg.ImageWidth = 320;
pLayerCfg.ImageHeight = 240;
pLayerCfg.Backcolor.Blue = 0xFF;
pLayerCfg.Backcolor.Green = 0xFF;
pLayerCfg.Backcolor.Red = 0xFF;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
/* USER CODE END LTDC_Init 2 */
No GFX, no DMA2D, just plain LTDC layer only configured. and LTDC clock is 6.4MHz.
No FB address set. because I set it by:
uint8_t RGB888_240x320[240 * 320 * 3];
/* blah blah ... */
memset(RGB888_240x320, 0xffu, sizeof(RGB888_240x320));
HAL_LTDC_SetAddress(&hltdc, (uint32_t)RGB888_240x320, LTDC_LAYER_1);
So, I expected white screen not black screen. and I checked all data lanes. Contrary to my expectations, none of the signals changed to HIGH. so all signals are LOW.
Is there an API to refresh or reload LTDC? or is there an API that must be called to start LTDC's pixel outputs?
2025-05-14 8:26 AM
Hello @jaehoon;
Could you please check the data enable polarity configuration?
The LTDC control signals (HSYNC, VSYNC, DE, and LCD_CLK) polarities must be configured respecting the display specifications.
Note: Only the DE control signal must be inverted versus the DE polarity indicated in the display datasheet. The other control signals must be configured exactly like the display datasheet.
I recommend you to look at AN4861 and precisely section 7 LTDC application examples and get inspired to configure the LTDC.
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-05-14 9:46 AM - edited 2025-05-14 10:00 AM
Yes I did check it already and its applied. my LCD datasheet exactly requires active high, so it's configured correctly I think. Currently pixel data signals(R0-7,G0-7,B0-7) are not working, just LOW. Is there an API to refresh or reload LTDC? or is there an API that must be called to start LTDC's pixel outputs?
DE: Active High, HSYNC + VSYNC: Active Low, CLK: Rising Edge.
LCD controller is ILI8961, so `DEN` pin of LCD will have positive polarity as default. and I wrote small program to initialize ILI8961 and it setup RGB888 interface on LCD.
/**
* initialization sequence, pairs of [REG, ARG].
* parameters:
*
* HA=320
* HSW=8
* HBP=8
* HFP=56
* VA=240
* VSW=8
* VBP=16
* VFP=8
* FPS=60
* HSYNC_POL=0 --0:LOW-ACT 1:HIGH-ACT
* VSYNC_POL=0 --0:LOW-ACT 1:HIGH-ACT
* DE_POL=0 --0:HIGH-ACT 1:LOW-ACT
* CLK_POL=0 --0:RISING-EDGE-LATCH 1:FALLING-EDGE-LATCH
*/
static const uint8_t YTS270_INIT_SEQ[] = {
0x2b, 0x01,
0x00, 0x0a,
0x0b, 0x80,
0x01, 0x9f,
// 0x00, 0xb5,
0x0c, 0x26,
// 0x06, 0x95,
// 0x07, 0x32,
0x2f, 0x69,
0x16, 0x00,
0x55, 0x00,
0x17, 0x74,
0x18, 0x44,
0x19, 0x37,
0x1a, 0x00,
0x3c, 0x87,
0x3d, 0x07,
0x3e, 0x74,
0x3f, 0x64,
0x40, 0x67,
0x41, 0x04,
0x3d, 0x00,
0x47, 0x12,
0x48, 0x28,
0x49, 0x53,
0x4a, 0x9e,
0x95, 0x20,
//0x55, 0x20,
0x6a, 0x03,
0x6b, 0x02
};
P.S. I've reballed and resoldered for the 5th time. I've soldered 2 boards and have 8 more chips to spare. my board is not EVAL or DK. custom. I'm not sure if I should try soldering a new chip to solve this problem.