2021-01-31 06:14 PM
Thank you for helping.
environment:
Board: STM32F746G-DISCO
TouchGFX Ver 4.15.0
The setting code output by TouchGFX is as follows.
It does not match the value on the LCD data sheet.
Please tell me how to calculate.
Thank you.
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 = 40;
hltdc.Init.VerticalSync = 9;
hltdc.Init.AccumulatedHBP = 53;
hltdc.Init.AccumulatedVBP = 11;
hltdc.Init.AccumulatedActiveW = 533;
hltdc.Init.AccumulatedActiveH = 283;
hltdc.Init.TotalWidth = 565;
hltdc.Init.TotalHeigh = 285;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init (& hdtdc)! = HAL_OK)
{
Error_Handler ();
}
2021-01-31 07:24 PM
Thank you for helping.
additional information.
I found the definition of squid on the following site.
If you follow from here, the set values will match.
So how did you decide on these values?
/ **
* @ brief RK043FN48H Timing
* /
# define RK043FN48H_HSYNC ((uint16_t) 41) / * Horizontal synchronization * /
# define RK043FN48H_HBP ((uint16_t) 13) / * Horizontal back porch * /
# define RK043FN48H_HFP ((uint16_t) 32) / * Horizontal front porch * /
# define RK043FN48H_VSYNC ((uint16_t) 10) / * Vertical synchronization * /
# define RK043FN48H_VBP ((uint16_t) 2) / * Vertical back porch * /
# define RK043FN48H_VFP ((uint16_t) 2) / * Vertical front porch * /
2021-02-01 12:29 AM
Hi,
I unfortunately do not know the reason why those valeus are different than the datasheet. Those settings were done by the intro pack teams a while ago (I can trace it back to more than 3 years), and are supposed to be "optimized", whatever that means without clear description:grinning_face_with_sweat:. We followed the same configuration for the TouchGFX Application templates.
When creating a project from scratch with CubeMX 6.1.1 for the F746 disco board, the LTDC will still be set the same way, so I doubt the hardware has changed in the latest revision of this board but I will investigate to see if we should update this.
You can try to change those settings yourself in the CubeMX project, under the "Multimedia" section in "LTDC" -> "Parameter Settings" and see if it breaks everything or not.
/Romain
2021-02-01 12:36 AM
PS: the datasheet indicates a range of values possible, so the settings in the AT are technically correct