//现象:PB灯闪动,周期是INTVERAL*(0.01)ms,可用来记时.
//demo by whut_wj
#include <hidef.h> /* common defines and macros */
#include <MC9S12XS128.h> /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12xs128"
#define INTVERAL 100
void SetBusClock(void)
{
CLKSEL=0X00; //disengage PLL to system
PLLCTL_PLLON=1; //turn on PLL
SYNR=2;
REFDV=1; //pllclock=2*osc*(1+SYNR)/(1+REFDV)=48MHz;
_asm(nop); //BUS CLOCK=24M
_asm(nop);
while(!(CRGFLG_LOCK==1)); //when pll is steady