I'm using a 5" (800x480 px) display on a LPC54608 controller. We have 16MB onboard Video RAM.
It's a "DE-Mode" display, so it ignores VSync and HSync. Data sheet: https://shop.lcd-module.de/media/attachment/file/eng/pdf/grafik/TFT050-84ANN.pdf
I got the Display to work with following parameters:
#define LCD_PANEL_CLK 36000000U //panel clock
#define LCD_PPL 800 //pixels per line
#define LCD_HSW 0 //hsync pulse width
#define LCD_HFP 0 //horizontal front porch
#define LCD_HBP 100 //horizontal back porch
#define LCD_LPP 480 //lines per panel
#define LCD_VSW 30 //vsync pulse width
#define LCD_VFP 0 //vertical front porch
#define LCD_VBP 45 //vertical back porch
CPU clock is at 144 MHz, RAM at 72MHz.
In the VSync ISR I count the display refresh in order to measure the refresh rate. (IRQHandler is from emwin example code)
uint32_t intStatus = LCDC_GetEnabledInterruptsPendingStatus(APP_LCD);
if (intStatus & kLCDC_VerticalCompareInterrupt)
if (s_LCDpendingBuffer >= 0)
/* Calculate address of the given buffer */
addr = VRAM_ADDR + VRAM_SIZE * s_LCDpendingBuffer;
/* Make the given buffer visible */
LCDC_SetPanelAddr(APP_LCD, kLCDC_UpperPanel, addr);
/* Send a confirmation that the given buffer is visible */
s_LCDpendingBuffer = -1;
/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
exception return operation might vector to incorrect interrupt */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
In theory I'd expext to have a refresh rate of
LCD_PANEL_CLK/((LCD_PPL+LCD_HBP)*(LCD_LPP+LCD_VBP)) = 81.9 Hz
I measure about 32Hz, which is barely enough to have no noticeable flicker. At 25MHz panel clock the measured refresh rate is at 20Hz and indeed I can see flickering, so the measurement seems to be correct.
Why is the refresh rate so low?