cancel
Showing results for 
Search instead for 
Did you mean: 

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

ausera uirwaij
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

7 REPLIES 7
Slh
Senior

Maybe you have to change the LCD Clock.

MM..1
Chief II
HAL_Delay(30);

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

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.

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.

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

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

closed​