中科因仑“3+1”工程特种兵精英论坛
标题:
msp430g2553 8M时钟
[打印本页]
作者:
leixiaofeng
时间:
2015-5-31 14:58
标题:
msp430g2553 8M时钟
你所指的稳定的8M时钟,有什么具体指标要求吗?
如果没有,就用内部DCO,配置到8M工作。
一下内容节选自TI官方例程,更多详细内容请到TI网站直接下载相关器件型号的例程:
#include <msp430g2553.h>
void main(void)
{
WDTCTL = WDTPW +WDTHOLD; // Stop Watchdog Timer
if (CALBC1_1MHZ ==0xFF || CALDCO_1MHZ == 0xFF)
{
while(1); // If calibration constants erased
// do not load, trap CPU!!
}
//1Mhz
BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation */
/* //8Mhz
BCSCTL1 = CALBC1_8MHZ; // Set range
DCOCTL = CALDCO_8MHZ; // Set DCO step + modulation */
/* //12Mhz
BCSCTL1 = CALBC1_12MHZ; // Set range
DCOCTL = CALDCO_12MHZ; // Set DCO step + modulation*/
/* //16Mhz
BCSCTL1 = CALBC1_16MHZ; // Set range
DCOCTL = CALDCO_16MHZ; // Set DCO step + modulation*/
P1DIR |= 0x13; // P1.0,1 and P1.4 outputs
P1SEL |= 0x11; // P1.0,4 ACLK, SMCLK output
while(1)
{
P1OUT |= 0x02; // P1.1 = 1
P1OUT &= ~0x02; // P1.1 = 0
}
}
欢迎光临 中科因仑“3+1”工程特种兵精英论坛 (http://bbs.enlern.com/)
Powered by Discuz! X3.4