UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
77 of 362
NXP Semiconductors
UM10208
Chapter 7: LPC2800 CGU
/* LCD_CLK, LCD bus clock of LCD interface = (1/10) * SYS base clock */
SYSFDCR3 &= ~CGU_FDCR_FDRUN; /* Stop the fractional divider */
SYSFDCR3 = ((SYSFDCR3_MSUB << 11) /* Set MSUB = -n */
| (SYSFDCR3_MADD << 3) /* Set MADD = m - n */
| CGU_FDCR_FDSTRCH /* Enable stretch */
| CGU_FDCR_FDRES); /* Reset fractional divider */
SYSFDCR3 &= ~CGU_FDCR_FDRES; /* Clear reset bit */
SYSFDCR3 |= CGU_FDCR_FDRUN; /* Restart the fractional divider */
/******************************** Spreading stage *************************************/
/* Choose clocks for spreading stages under SYS */
APB0ESR0 = 0x0; /* The same as the SYS base clock */
APB1ESR0 = 0x0; /* The same as the SYS base clock */
APB2ESR0 = 0x0; /* The same as the SYS base clock */
APB3ESR0 = 0x0; /* The same as the SYS base clock */
MMIOESR0 = 0x0; /* The same as the SYS base clock */
AHB0ESR = 0x0; /* The same as the SYS base clock */
MCIESR0 = 0x0; /* The same as the SYS base clock */
UARTESR0 = 0x0; /* The same as the SYS base clock */
FLSHESR0 = 0x0; /* The same as the SYS base clock */
FLSHESR1 = 0x0; /* The same as the SYS base clock */
FLSHESR2 = 0x0; /* The same as the SYS base clock */
LCDESR0 = 0x0; /* The same as the SYS base clock */
DMAESR0 = 0x0; /* The same as the SYS base clock */
DMAESR1 = 0x0; /* The same as the SYS base clock */
USBESR0 = 0x0; /* The same as the SYS base clock */
CPUESR0 = 0x0; /* The same as the SYS base clock */
CPUESR1 = 0x0; /* The same as the SYS base clock */
CPUESR2 = 0x0; /* The same as the SYS base clock */
RAMESR = 0x0; /* The same as the SYS base clock */
ROMESR = 0x0; /* The same as the SYS base clock */
EMCESR0 = 0x0; /* The same as the SYS base clock */
EMCESR1 = 0x0; /* The same as the SYS base clock */
MMIOESR1 = 0x0; /* The same as the SYS base clock */
MCIESR1 = CGU_ESR_FD1; /* Select spreading stage MCI_MCLK, MCI clock of SD/MCI interface */
LCDESR1 = CGU_ESR_FD3; /* Select spreading stage LCD_CLK, LCD bus clock of LCD interface */
SYSBCR = CGU_BCR_FDRUN; /* Start fractional dividers */
5.2 Example 2: Programming the USB, SDRAM, MCI, and LCD interfaces
using the CGU
Using USB and SDRAM requires the following clock restrictions:
•
If USB is used then the USB_HCLK (AHB clock for USB interface) should not be less
than 30 MHz.