1、测试程序
#include <msp430x24x.h>
void main(void)
{
WDTCTL = WDTPW +WDTHOLD; // Stop Watchdog Timer
// DCOCTL = DCO0 + DCO1 + DCO2; // Max DCO
// BCSCTL1 &= ~XT2OFF;//+RSEL2 + RSEL1 + RSEL0; // XT2on, max RSEL
// BCSCTL2 =SELS;//+SELM0+DIVM1+DIVM0+DIVS0 ; // SMCLK = XT2
BCSCTL1 =CALBC1_1MHZ; //设定DCO为1MHZ
DCOCTL =CALBC1_1MHZ;
P5DIR |= 0x70; // P5.6,5,4 outputs
P5SEL |= 0x70; // P5.6,5,5 options
while(1);
}
测试数据:
MCLK=1.430M;SMCLK=1.430M;32.768K。
2、测试程序
#include <msp430x24x.h>
void main(void)
{
WDTCTL = WDTPW +WDTHOLD; // Stop Watchdog Timer
// DCOCTL = DCO0 + DCO1 + DCO2; // Max DCO
// BCSCTL1 &= ~XT2OFF;//+RSEL2 + RSEL1 + RSEL0; // XT2on, max RSEL
// BCSCTL2 =SELS;//+SELM0+DIVM1+DIVM0+DIVS0 ; // SMCLK = XT2
DCOCTL =CALBC1_8MHZ;
BCSCTL1 =CALBC1_8MHZ; //设定DCO为1MHZ
BCSCTL2 =SELS;
P5DIR |= 0x70; // P5.6,5,4 outputs
P5SEL |= 0x70; // P5.6,5,5 options
while(1);
}
测试数据:
MCLK=1.430M;SMCLK=1.430M;32.768K。(同上)
3、用CALBC1=12MHZ和CALBC1=16MHZ时,没有信号输出。
|