数据手册上写的很清除,推荐外接电阻的方式使用DCO 我外接100k电阻,一端接至VCC,一端接至Rosc 程序如下: WDTCTL=WDTPW+WDTHOLD; // Stop watchdog timer _BIS_SR(OSCOFF); // LFXT1 not used _BIS_SR(SCG1); //turn off SMCLK _BIC_SR(OFIE); //disable oscillator fault interrupt DCOCTL =0x6F; //DCOx=3,MODx=16,a moderate "t" BCSCTL1=0x80; // XT2 is off,Low frequency mode,RSELx=0 BCSCTL2=0x01; //DCO for MCLK, external resister, //no divider of MCLK
P5DIR |= 0x10; // P5.6 work as MCLK output P5SEL |= 0x10;
然后用示波器看P5.6输出,输出正常方波,大约过了十几秒,MCLK突然消失
有没有大虾遇到过这种情况?是什么原因呢 |