Skip to main content
ausera uirwaij
Associate III
November 11, 2022
Solved

4.3" TFT-LCD always blinks using LTDC+ external SDRAM interfacing with FMC

  • November 11, 2022
  • 7 replies
  • 3726 views

Hi, I have tested my 4.3" TFT-LCD by write the whole screen with one color blue or orange freshing with about 34hz, but it blinks.

0693W00000WI6lRQAT.jpgthe test code run in main function:

  int ii=0;

  int cl =0x0;//color

  while(1)

  {

  

if(ii==0)

{

 ii =1;

cl =0xFF00;

}else

{

ii =0;

cl =0x00FF;

}

 LTDC_Clear(cl);//change the sceens color.

HAL_Delay(30);

  }

​

the clock of tftlcd is 10Mhz, and its resolution is 480*272, LTDC_Clear() runs DMA2D to freshing data like this:

CS_UINT32 timeout = 0;

DMA2D->CR = DMA2D_R2M;  // dma2d mode: register to memory.

  DMA2D->OPFCCR = DMA2D_OUTPUT_RGB565;

  DMA2D->OCOLR = color;

  DMA2D->OMAR = (CS_UINT32)addr;

  DMA2D->OOR = offsetLine;  //offset

  DMA2D->NLR = (CS_UINT32)(xSize << 16) | (uint16_t)ySize;

   

  DMA2D->CR |= DMA2D_CR_START;

  while (DMA2D->CR & DMA2D_CR_START) {

  timeout++;

  if (timeout > 0X1FFFFF) break;  

thank you.

​

​

​

​

​

This topic has been closed for replies.
Best answer by MM..1

OK little explain LTDC is hw for transfer pixel from framebuffer memory to LCD hw lines in RGB mode. This is based on LCD_CLK and transfer continuosly what is in memory.

DMA is hw for move data from one place to other , but no to display directly = no refresh relevant.

For sync this two hw you need implement frame interrupts. Plus timing calc...

Your code start change color without sync and info what part LTDC actualy draw...

7 replies

Slh
Senior
November 11, 2022

Maybe you have to change the LCD Clock.

ausera uirwaij
Associate III
November 12, 2022

the manual of my tft-lcd displayer requires its LCD clock 8Mhz~12Mhz, and I set 10Mhz. I tried to improve and lower the clock frequency it has not too much effect. And the supplier of displayer ask me to work with 10Mhz.

So could you let me know why you give me such advice?

thank you.

MM..1
Super User
November 11, 2022
HAL_Delay(30);

you completely dont understand how DMA and LCD works... Tryy bigger delay

ausera uirwaij
Associate III
November 12, 2022

I tried 1000ms delay it seems work, but I need 40hz fresh rate at least. I check the LTDC guide which writes:

0693W00000WIA2LQAX.pngAnd total width = 523,total height = 286, so the refresh rate can reach 66.8hz when LTDC clock is 10Mhz, my tft-lcd can work between 8Mhz~12Mhz's clock.