At 12:22 AM 11/23/03 +0000, you wrote:
>I just added some code to the Rowley LED flasher example to set up the PLL
>for 60 MHz operation; it looks as though it is running six times faster,
>judging by the LEDs. I filched it from some other code someone sent me that
>he's written for his own hardware, based on the Ashling board circuit.
>Here's the routine, if anyone else wants to try it:
> *pllCFG = 0x25; // P = 2, M = 6
> *pllCON = 0x01; // Enabling PLL but not connecting it
> *pllFEED = 0xAA; // Actualising the setting
>
> for(i=1;i<10;i++); // waiting
>
> *pllFEED = 0x55; // Actualising the setting
>
> while ( !(*pllSTAT & 0x0400) ) ; // waiting for PLL lock
>
> // connecting PLL
>
> *pllCON = 0x03; // Enabling PLL but not connecting it
> *pllFEED = 0xAA; // Actualising the setting
> for(i=1;i<10;i++); // waiting
> *pllFEED = 0x55; // Actualising the setting
A question Leon. Why did you put the delay in between the writes to pllFEED?
Heres an alternative (it's what I am using).
void init_pll( void)
{
/* set pll divisor, multiplier */
PLLCFG = 0x25; /* MSEL = 5 --> M = 6, PSEL = 1 --> P = 2 */
/* cclk = M*Fosc = 60,000,000 */
/* Fcco = cclk * 2 * P = 240,000,000 */
/* enable pll */
PLLCON = 1; /* Enables PLL */
PLLFEED = 0xAA; /* Change to setting above. These two updates */
PLLFEED = 0x55; /* MUST occur in sequence on the VPB bus. */
/* wait for lock */
while( (PLLSTAT & 0x400) == 0) {
}
/* connect pll */
PLLCON = 3; /* Enables and connects PLL */
PLLFEED = 0xAA; /* Change to setting above. These two updates */
PLLFEED = 0x55; /* MUST occur in sequence on the VPB bus. */
}
Robert AdsettMessage
Re: [lpc2100] PLL
2003-11-23 by Robert Adsett
Attachments
- No local attachments were found for this message.