TI专家,各位朋友:
我想把PLL0配置Bypass模式,可是发现PLLCTL寄存器无法写入。配置代码如下:
void PLL0_Bypass_Config(void) { SysCfgRegistersUnlock(); CFGCHIP0=CFGCHIP0&(~(1<<4)); //Clear the PLLENSRC bit in PLLCTL to 0 (allows PLLEN bit to take effect). PLLCTL&=(~(1<<5)); //For PLL0 only, select the clock source by programming the EXTCLKSRC bit in PLLCTL. PLLCTL&=(~(1<<9)); //Clear the PLLEN bit in PLLCTL to 0 (PLL in bypass mode). PLLCTL=(~(0x00000001)); //Wait for 4 OSCIN cycles to ensure that the PLLC has switched to bypass mode. for(num=0;num<4;num++) { asm(" NOP"); } // Clear the PLLRST bit in PLLCTL to 0 (resets PLL). PLLCTL=PLLCTL&(~(1<<3)); /*Set the PLLRST bit in PLLCTL to 1 to bring the PLL out of reset*/ PLLCTL |= 0x8; /*Wait for PLL to lock. See PLL spec for PLL lock time*/ for(num=0;num<2400;num++) { asm(" NOP"); } CFGCHIP0=CFGCHIP0|((1<<4)); SysCfgRegistersLock(); }
执行完上面的函数后,PLLCTL寄存器的值没有发生变化。但是调试中在CFGCHIP0=CFGCHIP0|((1<<4));这句设置断点,通过CCS查看寄存器那里,可以修改PLLCTL寄存器的值。请问上面的配置哪里有问题吗?
wei lee1:
回复 Tony Tang:
#1:芯片上电后默认是bypass模式,我通过仿真器调试的时候,使用了gel,配置了PLL0和PLL1。main函数中想把PLL0重新调整为bypass模式。只所以这样做,是因为手册上说DSP进入DEEPSLEEP模式之前,需要先把PLL0给bypass。
#2:后面的步骤确实有点多余,但是我确实是遇到了问题。PLLCTL的第0位PLLEN没法clear为0。