pit定时器128芯片

时间:2017-10-13 10:25:48
【文件属性】:

文件名称:pit定时器128芯片

文件大小:158KB

文件格式:MCP

更新时间:2017-10-13 10:25:48

128 pit 定时器

//现象:PB灯闪动,周期是INTVERAL*(0.01)ms,可用来记时. //demo by whut_wj #include /* common defines and macros */ #include /* 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


网友评论