Hi
I hope someone can help me or give me some clues to help solve my problem.
I am having some trouble getting the LPC2478 LCD controller to do anything other than output the LCDDCLK signal. I am using the following TFT panel setup and after the LCD controller is enabled and powered up I see the signals LCDPWR, LCDFP, LCDLP go high but no toggling.
All other signals, apart from the LCDDCLK, are always low. I can change the LCDCLK frequency so I would assume the LCD controller is correctly powered up and switch on.
I would assume that with the timings setup I would see LCDFP, LCDEN toggling regardless of the graphics RAM buffer, is this correct?
My setup code is:
int LCD_Initialise ( void ) { uint16_t regValue = 0; uint16_t *pPal = NULL; uint32_t i = 0; /* LCD specific setup */ uint16_t hbp = 2; /* Horizontal back porch */ uint16_t hfp = 2; /* Horizontal front porch */ uint16_t hsw = 10; /* HSYNC pulse width */ uint16_t ppl = 800; /* Pixels per line */ uint16_t vbp = 2; /* Vertical back porch */ uint16_t vfp = 2; /* Vertical front porch */ uint16_t vsw = 4; /* VSYNC pulse width */ uint16_t lpp = 480; /* Lines per panel */ /************ LPC2478 LCD controller setup ***************/ PCONP |= PCONP_PCLCD; /* Power Control for LCD controller */ /* Configure LCD GPIO pins */ PINSEL11 = 0x0000000F; /* Set TFT 24 bit and enable LCD port */ PINSEL10 = 0; /* Disable Embedded Trace Module (ETM) */ PINSEL0 = (PINSEL0 & 0xFFF000FF) | 0x00055500;/* Enable LCDVD[0,1,8,9,16,17] */ PINSEL3 = (PINSEL3 & 0xF00000FF) | 0x05555500;/* Enable LCDVD[10..15,20..23] */ PINSEL4 = (PINSEL4 & 0xF0300000) | 0x054FFFFF;/* Enable LCDPWR, LCDLE, LCDDCLK, LCDFP, LCDENAB, LCDLP,LCDVD[4..7,18,19], LCDCLKIN */ PINSEL9 = (PINSEL9 & 0xF0FFFFFF) | 0x0A000000;/* Enable LCDVD[2..3] */ /* Disable the display */ LCD_CTRL &= ~LCD_CTRL_LCDEN; /* Setup horizontal and vertical timing */ regValue= ( ((((ppl/16)-1)&0x3F) << 2) | (( (hsw-1) &0xFF) << 8) | (( (hfp-1) &0xFF) << 16) | (( (hbp-1) &0xFF) << 24) ); LCD_TIMH = regValue; /* Horizontal timing registers */ regValue =((((lpp-1) &0x3FF) << 0) | (((vsw-1) &0x03F) << 10) | (((vfp-1) &0x0FF) << 16) | (((vbp-1) &0x0FF) << 24) ); LCD_TIMV = regValue; /* Vertical timing registers */ /* Setup polarities of signals */ regValue = 0; /* Clocks per line (CPL) */ regValue |= ( ( (ppl-1) & 0x3FF) << 16); /* Panel clock divisor, lower 5 bits */ regValue |= 0x04; LCD_POL = regValue; /* Set the polarity register */ /* Line end control not required */ LCD_LE = 0; /* Disable interrupts */ LCD_INTMSK = 0; /* 24 bits per pixel */ regValue = LCD_CTRL_LCDBPP_24; /* TFT display */ regValue |= LCD_CTRL_LCDTFT; LCD_CTRL = regValue; /* Set the LCD control register */ /* LCD configuration register, prescaler */ LCD_CFG = 0x00000000; /* LCD enable */ LCD_CTRL |= LCD_CTRL_LCDEN; /* Power on LCD */ LCD_CTRL |= LCD_CTRL_LCDPWR; return (PASS); }
Looking at the uVision debugger peripherals for the Pin Connect shows the GPIO set up correctly, as I can see, with values of:
PINSEL0 = 0x00555550 PINSEL1 = 0x00000000 PINSEL2 = 0x00000000 PINSEL3 = 0x05555500 PINSEL4 = 0x054FFFFF PINSEL5 = 0x55010115 PINSEL6 = 0x55555555 PINSEL7 = 0x55555555 PINSEL8 = 0x55555555 PINSEL9 = 0x5A055555 PINSEL10= 0x00000000
I would be grateful for any suggestion to why I'm not seeing the timing signals output.
Thanks in advance.