关于测速的程序.docVIP

  • 5
  • 0
  • 约1.85千字
  • 约 3页
  • 2018-06-25 发布于河南
  • 举报
关于测速的程序

include hidef.h? ?? ?/* common defines and macros */ #include MC9S12XS128.h? ???/* derivative information */ #pragma LINK_INFO DERIVATIVE mc9s12xs128 unsigned int Get_pulse; ? ?int k; void SetBusCLK_32M(void) {? ? ? ? CLKSEL=0X00;? ? //disengage PLL to system ? ? PLLCTL_PLLON=1;? ?//turn on PLL ? ? SYNR=3;? ?? ?? ? ? ? REFDV=1;? ?? ?? ? //pllclock=2*osc*(1+SYNR)/(1+REFDV)=64MHz; ? ? _asm(nop);? ?? ?? ? //BUS CLOCK=32M ? ? _asm(nop); ? ? while(!(CRGFLG_LOCK==1));? ?//when pll is steady ,then use it; ? ? CLKSEL_PLLSEL =1;? ?? ?? ? //engage PLL to system; } void PACBInit() { //TIOS=0xfe; ??TC

文档评论(0)

1亿VIP精品文档

相关文档