int main( void )
{
unsigned int i, j;
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
PMAPPWD = 0x02D52; // Enable Write-access to modify port mapping registers
P2MAP7 = PM_MCLK;
PMAPPWD = 0; // Disable Write-Access to modify port mapping registers
P2DIR |= BIT1;
P1DIR |= BIT0; //ACLK OUTPUT
P1SEL |= BIT0;
P3DIR |= BIT4; //SMCLK OUTPUT
P3SEL |= BIT4;
P2DIR |= BIT7; //MCLK OUTPUT
P2SEL |= BIT7;
// P5SEL |= BIT4 + BIT5; // XT1CLK
P7SEL |= BIT2 + BIT3; //XT2CLK
UCSCTL6 &= ~XT2OFF;
//UCSCTL6 |= XT2BYPASS;
UCSCTL6 &= ~XT1OFF;
//UCSCTL6 |= XT1BYPASS;
UCSCTL6 |= XCAP_3;
UCSCTL3 = SELREF__XT1CLK;
UCSCTL4 |= SELA__XT2CLK + SELM__XT2CLK + SELS__XT1CLK;;
while(SFRIFG1 & OFIFG)
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
SFRIFG1 &= ~OFIFG; //clear osc fault interrupt flag
}
。。。。。。
}
脚位一直看不到32.768khz, 而且一直都在while 里面 跳步出来?? 32768的晶振换了好几种都不行,难道芯片有问题? |