while(BAKCTL & LOCKIO)
BAKCTL &= ~(LOCKIO);
为什么这个句子能 解锁XT1引脚
#include <msp430f6638.h>
void main (void)
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= BIT0;
P1SEL |= BIT0;
P3DIR |= BIT4;
P3SEL |= BIT4;
while(BAKCTL & LOCKIO) //解锁XT1引脚 ///////////////////////////////////
BAKCTL &= ~(LOCKIO);
P7SEL |= BIT2 + BIT3;
UCSCTL6 &= ~XT2OFF;
UCSCTL6 &= ~(XT1OFF);
UCSCTL6 |= XCAP_3;
do
{
UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + DCOFFG);
SFRIFG1 &= ~OFIFG;
}while(SFRIFG1&OFIFG);
UCSCTL6 &= ~XT2DRIVE0;
UCSCTL4 |= SELA_0 + SELS_5;
while(1);
}
|