void InitPLL(void)
[
int i = 0;
Uint8 CLKMODE = 1; //方波
Uint8 PLLM = 19; //25*(19+1)=500M
Uint8 POSTDIV = 1; // clk_M / 2 = 250M
Uint8 PLLDIV2 = 1;
Uint8 PLLDIV3 = 2; //250/3=83M
Uint8 PLLDIV5 = 5;
Uint8 PLLDIV7 = 7;
Uint8 PREDIV = 0;
PLL0_PLLCTL &= 0xFFFFFFFE;
for(i=0; i
PLL0_PLLCTL &= 0xFFFFFEFF;
PLL0_PLLCTL |= (CLKMODE<<8);
PLL0_PLLCTL &= 0xFFFFFFDF;
PLL0_PLLCTL &= 0xFFFFFDFF;
PLL0_PLLCTL &= 0xFFFFFFF7;
PLL0_PLLCTL |= 0x10;
PLL0_PLLCTL &= 0xFFFFFFFD;
PLL0_PLLCTL &= 0xFFFFFFEF;
PLL0_PREDIV = 0x8000 | PREDIV;
PLL0_PLLM = PLLM; /* Make PLLMULTIPLEIR as bootpacket*/
PLL0_POSTDIV = 0x8000 | POSTDIV; /* Make POSTDIV as bootpacket*/
while(PLL0_PLLSTAT & 0x1==1)[]
PLL0_PLLDIV2 = 0x8000 | PLLDIV2;
PLL0_PLLDIV3 = 0x8000 | PLLDIV3; /* Make PLLDIV3 as bootpacket, do it for other PLLDIVx to if required*/
PLL0_PLLDIV5 = 0x8000 | PLLDIV5; /* Make PLLDIV5 as bootpacket, do it for other PLLDIVx to if required*/
PLL0_PLLDIV7 = 0x8000 | PLLDIV7; /* Make PLLDIV7 as bootpacket, do it for other PLLDIVx to if required*/
PLL0_PLLCMD |= 0x1;
while(PLL0_PLLSTAT & 0x1==1) [ ]
PLL0_PLLCTL |= 0x8;
for(i=0; i
PLL0_PLLCTL |= 0x1;
KICK0R = 0x83e70b13; // Kick0 register + data (unlock)
KICK1R = 0x95a4f1e0; // Kick1 register + data (unlock)
]