4.3" TFT-LCD always blinks using LTDC+ external SDRAM interfacing with FMC
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.
the 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.