This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
芯片MSP430G2553的ACLK可以作为主系统时钟吗?
测试过:把系统时钟设置为ACLK,不分频,将IO口P1.0高低变换。测得频率为DCO频率,XT1OF失效标志置位。
但是用户指南里写了主时钟可以从LFXT1CLK输入。所以很疑惑。。。
你好,目测是你外部时钟的问题。
我做了一个实验,用的是外部32.768K的晶振,
设置ACLK=LFXT1=32.768K
MCLK = LFXT1=32.768K
SMCLK = DCO = 1.04M
程序如下:
#include <msp430.h>
unsigned char i;
int main(void)
{
WDTCTL = WDTPW +WDTHOLD;// Stop Watchdog Timer
while(IFG1 & OFIFG)
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 10; i > 0; i--);
}
BCSCTL2 |= SELM_3; // MCLK = LFXT1
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
}
}
效果如下:
ACLK P1.0
MCLK/10 P1.1
SMCLK P1.4
所得得频率有点偏差,是我示波器的问题。