#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
void mcuinit()
{
DisableInterrupts; //forbid interrupt
CLKSEL_PLLSEL=0; //choose the crystal
PLLCTL_PLLON=0; // close off the pll
SYNR=0X02; // set the rate
REFDV=0X01; // pllclk=2*oscclk*(synr+1)/(refdv+1)
PLLCTL_PLLON=1; // open the pll
while((CRGFLG&0X08)==0X00); // check whether the pll is steady
CLKSEL_PLLSEL=1; //choose the pllclk ,now fbus=24mhz
EnableInterrupts;
}