cancel
Showing results for 
Search instead for 
Did you mean: 

how to set up LTDC Hsync,Vsync and porch value???

ikassma
Senior

hi.

I am using STM32F767 to control RGB TFT LCD. Data is output on the screen with TouchGFX.

But sometimes the screen momentarily breaks for a very short period of time and then comes back.

When I changed the porch value of LTDC, the cycle of symptoms changed.

0693W000005ABMNQA4.pngThe following is the data on the Porch of my LCD. How to change LTDC's Porch value?

current LCD Clock is 32 Mhz.

#define  T080800480_A1TMN_003_HSYNC            ((uint16_t)1)   /* Horizontal synchronization */
#define  T080800480_A1TMN_003_HBP              ((uint16_t)46)   /* Horizontal back porch      */
#define  T080800480_A1TMN_003_HFP              ((uint16_t)210)   /* Horizontal front porch     */
#define  T080800480_A1TMN_003_VSYNC            ((uint16_t)2)   /* Vertical synchronization   */
#define  T080800480_A1TMN_003_VBP              ((uint16_t)23)    /* Vertical back porch        */
#define  T080800480_A1TMN_003_VFP              ((uint16_t)22)    /* Vertical front porch       */
 
hLtdcHandler.Init.HorizontalSync = (T080800480_A1TMN_003_HSYNC - 1);
  hLtdcHandler.Init.VerticalSync = (T080800480_A1TMN_003_VSYNC - 1);
  hLtdcHandler.Init.AccumulatedHBP = (T080800480_A1TMN_003_HSYNC + T080800480_A1TMN_003_HBP - 1);
  hLtdcHandler.Init.AccumulatedVBP = (T080800480_A1TMN_003_VSYNC + T080800480_A1TMN_003_VBP - 1);
  hLtdcHandler.Init.AccumulatedActiveH = (T080800480_A1TMN_003_HEIGHT + T080800480_A1TMN_003_VSYNC + T080800480_A1TMN_003_VBP - 1);
  hLtdcHandler.Init.AccumulatedActiveW = (T080800480_A1TMN_003_WIDTH + T080800480_A1TMN_003_HSYNC + T080800480_A1TMN_003_HBP - 1);
  hLtdcHandler.Init.TotalHeigh = (T080800480_A1TMN_003_HEIGHT + T080800480_A1TMN_003_VSYNC + T080800480_A1TMN_003_VBP + T080800480_A1TMN_003_VFP - 1);
  hLtdcHandler.Init.TotalWidth = (T080800480_A1TMN_003_WIDTH + T080800480_A1TMN_003_HSYNC + T080800480_A1TMN_003_HBP + T080800480_A1TMN_003_HFP - 1);
  
  /* LCD clock configuration */
//  BSP_LCD_ClockConfig(&hLtdcHandler, NULL);
 
 
 
  /* Initialize the LCD pixel width and pixel height */
  hLtdcHandler.LayerCfg->ImageWidth  = T080800480_A1TMN_003_WIDTH;
  hLtdcHandler.LayerCfg->ImageHeight = T080800480_A1TMN_003_HEIGHT;
 
 
 
  /* Background value */
  hLtdcHandler.Init.Backcolor.Blue = 0;
  hLtdcHandler.Init.Backcolor.Green = 0;
  hLtdcHandler.Init.Backcolor.Red = 0;
  
  /* Polarity */
  hLtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL;
  hLtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL; 
  hLtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL;  
  hLtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
  hLtdcHandler.Instance = LTDC;

This is my configuration code.

@Martin KJELDSEN​ can you help me???

3 REPLIES 3
Martin KJELDSEN
Chief III

"The cycle of symptoms" changed to what?

Looks like your configuration is according to spec - Have you tried changing T080800480_A1TMN_003_VSYNC within that allowed range (1-20) - currently 2.

I found the rendering time to be lacking.

In Model::tick(), it was confirmed that the data is constantly being updated. By changing this to an appropriate level, all problems were solved.

​Ah, great 🙂