2021-01-26 01:45 PM
Hello,
i'm running touchgf in my 720x720 18bit display. I need to decrease the fps because of the heavy rendering time.
I know that to decrease the refresh rate i need to change the LTDC clock frequency. Now it is working with 25MHz (which should be approximately 50Hz). I know also that i need to change the porch timings when i decrease the TFT frequency.
Actually they are:
HSW = 20
HBP = 20
Active Width = 720
HFP = 10
VSH = 10
VBP = 10
Active Height= 720
VFP = 10
My question is how much i need to decrease each value to get 25Hz frame rate? I kown that i have to change the TFT clock to 13MHz, but what about porch timings?
2021-01-26 11:49 PM
Porch dont need changes , in datasheet is defined as min max typical . Only clock . Your actual FPS is around 45Hz , then try 16MHz ...
But better is leave FPS up and optimize rendering , maybe double buffer ...
2021-01-27 03:13 AM
I'm still using the double buffer, but when i need to render full screen animations it is not fluid. With 50% screen it is always fluid.
It is strange that i don't need to change the porch, because if i change only the clock the display doesn't show the image correctly. Only with 25MHz - 30MHz
2021-01-27 03:56 AM
When your display is DSI you need change some other but for RGB isnt changing porch critical. But your data when SYNC and BackPorch is equal isnt standart, check pdf for controller IC on LCD.
2021-01-27 04:02 AM
I used this display, the porch settings are
2021-01-27 04:13 AM
ok and valid pclk? try show ltdc init code
2021-01-27 04:17 AM
They are not written in the datasheet, however it is working with 25MHz
2021-01-27 04:30 AM
In datasheet is defined as Tclk on your image then seach time def and calculate f.
And pls show ltdc init function from your code
2021-01-27 11:38 AM
I don't understand what you mean with "In datasheet is defined as Tclk on your image then seach time def and calculate f.".
This is the init function
static void MX_LTDC_Init(void)
{
/* USER CODE BEGIN LTDC_Init 0 */
/* USER CODE END LTDC_Init 0 */
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 = 19;
hltdc.Init.VerticalSync = 9;
hltdc.Init.AccumulatedHBP = 39;
hltdc.Init.AccumulatedVBP = 19;
hltdc.Init.AccumulatedActiveW = 759;
hltdc.Init.AccumulatedActiveH = 739;
hltdc.Init.TotalWidth = 769;
hltdc.Init.TotalHeigh = 749;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 720;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 720;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
pLayerCfg.Alpha = 255;
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg.FBStartAdress = 0xC0000000;
pLayerCfg.ImageWidth = 720;
pLayerCfg.ImageHeight = 720;
pLayerCfg.Backcolor.Blue = 0x0;
pLayerCfg.Backcolor.Green = 0x0;
pLayerCfg.Backcolor.Red = 0x0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
/* USER CODE END LTDC_Init 2 */
}
2021-01-27 11:48 AM
From you datasheet image DE signal seems be active HIGH, but you set in ltdc AL. try change AH and too clock polarity...
And Tclk is time period for pixel clock. Then maybe in datasheet is definet as MAX Tclk for example 100ns , that is min freq 10MHz
and min Tclk for example 20ns .... 50MHz