Content originally posted in LPCWare by salimnawaz on Fri Oct 11 04:41:08 MST 2013
hi!
i am working on a lpc1857 development kit that comes with a colour lcd
the demo code uses nxp driver lib
i have set lpc1857 to 180mhz n it runs without any issue. the following is used for this purpose
uint32_tCGU_Init(void){
CGU_SetXTALOSC(12000000);
CGU_EnableEntity(CGU_CLKSRC_XTAL_OSC, ENABLE);
CGU_EntityConnect(CGU_CLKSRC_XTAL_OSC, CGU_CLKSRC_PLL1);
// Disable PLL1 CPU hang???
//CGU_EnableEntity(CGU_CLKSRC_PLL1, DISABLE);
//PLL1 Setup
// CGU_SetPLL1(6);// original
// modified by salim on 2 Oct 2013 for 2 step increase in frequency
// as mentioned in User Manual Section 10.2.1 page 89
// from 12MHz to 72MHz(<90MHz), 72 Mhz to 108MHz and 108MHz to 180Mhz
//CGU_SetPLL1(MUL_1);
CGU_SetPLL1(MUL_6);// Set Pll1 to 72 MHzLow Frequency
CGU_SetPLL1(MUL_9); // Set Pll1 to 108 MHz Mid Frequency
CGU_SetPLL1(MUL_15);// Set Pll1 to 180 MHz High Frequency
// end salim
CGU_EnableEntity(CGU_CLKSRC_PLL1, ENABLE);
CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_BASE_M3);
CGU_UpdateClock();
return 0;
}
for setting up LCD Clock i use following code:
CGU_SetDIV(CGU_CLKSRC_IDIVE, LCD_CLKDIV); // LCD_CLKDIV was 15 when LPC was running at 72Mhz
CGU_EntityConnect(CGU_CLKSRC_PLL1, CGU_CLKSRC_IDIVE);
CGU_EntityConnect(CGU_CLKSRC_IDIVE,CGU_BASE_LCD);
I have tried varying LCD_CLKDIV but when i set LPC at frequencies greater than 120 MHz my Lcd displays gets distorted really bad. when running at 120 MHz and below changing LCD_CLKDIV changes refresh rate of the lcd but its works fine. i suppose that code is fine... so m unable to understand what exactly is going wrong.
so can anyone guide through this issue????
thanks and regards
Salimnawaz