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
  • 2 replies
  • 3682 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...

2 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
Chief III
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

And, it should complete transmitting 2D data to LCD when DMA2D->CR 's DMA2D_CR_START is set? if so, could I begin another flushing operation immediately to wanted fresh rate? 

thank you.​

MM..1
MM..1Best answer
Chief III
November 12, 2022

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...