关键词不能为空

当前您在: 主页 > 英语 >

飞思卡尔光电编码器测速程序

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-12 02:39
tags:

-

2021年2月12日发(作者:爱恨交织)


#include







/* common defines and macros */


#include






/* derivative information */


#pragma LINK_INFO DERIV


ATIVE




volatile uint speed_back=0,temp=0;




void delay_ms(uint ms)


{






volatile uint x=0;






while(ms--)






{










for(x=2800;x>0;x--)










{












_asm(nop);












_asm(nop);












_asm(nop);












_asm(nop);












_asm(nop);












_asm(nop);










}







}


}



//


注意外接


16M


晶体。



//


飞思卡尔推荐配置,主频道


50MHZ


,速度更快!< /p>



void Init_PLL(void)


{






CLKSEL = 0X00;




//disengage PLL to system






PLLCTL_PLLON = 1;




//turn on PLL






SYNR = (0xc0|0x18);



//SYDIV=0X18=24




























REFDV = (0x40|0x07); //REFDIV=0X07=7






POSTDIV = 0x00;








//pllclock=2*osc*(1+SYDIV)/(1+REFDIV)=100 MHz;






_asm(nop);











//BUS CLOCK=50M






_asm(nop);






_asm(nop);
















_asm(nop);






_asm(nop);
















_asm(nop);






_asm(nop);






_asm(nop);
















_asm(nop);

-


-


-


-


-


-


-


-



本文更新与2021-02-12 02:39,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/640567.html

飞思卡尔光电编码器测速程序的相关文章