LCD Driver LPC177x_8x_lcd.c clocking question

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by EReyes on Mon Feb 06 21:44:11 MST 2012
I pulled the latest version on the driver library git repository. When I tried to use the LCD driver I found the clock was not being generated correctly (checked with an oscilloscope).

This is the relevant code (starts at line 114)

// Set clock
LPC_LCD->POL &= ~(0x01 << 5);
if( pConfig->panel_clk > 0) {
          clkdiv = CLKPWR_GetCLK(CLKPWR_CLKTYPE_CPU) / pConfig->panel_clk - 1;
  LPC_SC->LCD_CFG = clkdiv & 0x1F;

Shouldn't the fourth line be like this?

          clkdiv = CLKPWR_GetCLK( <FONT COLOR="Red">CLKPWR_CLKTYPE_PER</FONT>) / pConfig->panel_clk - 1;

I was under the impression the LCD module is clocked by the peripheral clock and not the core clock.