|
本人使用LM3S811,需要产生频率25MHz左右的PWM波。所以,使用PLL将系统频率倍频为200MHz,然后PWM周期计数设为8。。。时钟配置代码如下:
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SysCtlLDOSet(SYSCTL_LDO_2_75V);
SysCtlDelay(3000);
SysCtlClockSet( SYSCTL_SYSDIV_1
| SYSCTL_USE_PLL
| SYSCTL_OSC_MAIN
| SYSCTL_XTAL_6MHZ
);
SysCtlDelay(3000);
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
最后的PWM波输出大约1.5MHz,根据手册161页,发现实际使用的是Internal Osc 12 MHz
难道上面我的时钟配置有误吗?
另:6MHz晶振可以正确配置
即:
SysCtlClockSet(SYSCTL_SYSDIV_2 // 2 DIV
| SYSCTL_USE_OSC // Use OSC
| SYSCTL_OSC_MAIN //
| SYSCTL_XTAL_6MHZ); // external osc
|
|