PLL
2003-11-23 by Leon Heller
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:
void initPLL(void)
{
unsigned char i;
volatile unsigned long * vicIntEnClear;
volatile unsigned char * pllCON;
volatile unsigned char * pllCFG;
volatile unsigned short * pllSTAT;
volatile unsigned char * pllFEED;
vicIntEnClear = (volatile unsigned long *)0xFFFFF014;
pllCON = (volatile unsigned char *)0xE01FC080;
pllCFG = (volatile unsigned char *)0xE01FC084;
pllSTAT = (volatile unsigned short *)0xE01FC088;
pllFEED = (volatile unsigned char *)0xE01FC08C;
// Disabling IT
*vicIntEnClear = 0xFFFFFFFF;
// Seting up the PLL frequency
*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
}
Leon
--
Leon Heller, G1HSM
Email: aqzf13@...
http://www.geocities.com/leon_heller