智能车制作
标题:
倍频
[打印本页]
作者:
379846690
时间:
2009-5-16 14:25
标题:
倍频
void SysClk_Init() //初始化锁相环64MHz
{
CLKSEL=0x00; //disengage PLL to system
PLLCTL_PLLON=1; //turn on PLL
SYNR=3;
REFDV=1; //pllclock=2*osc*(1+SYNR)/(1+REFDV)=64MHz;
while(!(CRGFLG_LOCK==1)); //等待系统时钟稳定
CLKSEL_PLLSEL =1; //选择PLL时钟作为系统时钟now pll_clk=64M and the Bus clk=32M
}
void SysClk_Init() //初始化锁相环64MHz
{
CLKSEL=0x00; //disengage PLL to system
PLLCTL_PLLON=1; //turn on PLL
SYNR=7;
REFDV=3; //pllclock=2*osc*(1+SYNR)/(1+REFDV)=64MHz;
while(!(CRGFLG_LOCK==1)); //等待系统时钟稳定
CLKSEL_PLLSEL =1; //选择PLL时钟作为系统时钟now pll_clk=64M and the Bus clk=32M
}
这两种设置有差别吗?
作者:
跳跃的心
时间:
2009-5-16 17:28
我觉得一样,结果一样,就是实现的途径不一样
作者:
chenrunshe_007
时间:
2009-5-17 00:54
用这个爽,C中嵌套汇编,更快
void Start_PLL(void) //busCLK=32M
{
REFDV=0x01; // PLLCLK =2*OSCCLK*(SYNR + 1)/(REFDV + 1)
SYNR=0x03; // =2*16M*3/2=64M
asm{
BRCLR CRGFLG,#$08,*
BSET CLKSEL,#$80
}
}
欢迎光临 智能车制作 (http://111.231.132.190/)
Powered by Discuz! X3.2