|
[code][/P1SEL = P2SEL = P3SEL = P4SEL = P5SEL = P6SEL = P7SEL = P8SEL = P9SEL = P10SEL = P11SEL =0;
P1DS = P2DS = P3DS = P4DS = P5DS = P6DS = P7DS = P8DS = P9DS = P10DS = P11DS = 0;
P1DIR = P2DIR = P3DIR = P4DIR = P5DIR = P6DIR = P7DIR = P8DIR = P9DIR = P10DIR = P11DIR = 0xFF;
P1OUT = P2OUT = P3OUT = P4OUT = P5OUT = P6OUT = P7OUT = P8OUT = P9OUT = P10OUT = P11OUT = 0x00;
P5OUT|=BIT4; //由于P5.4和P3.7连接了电阻,要将其置高
P3OUT|=BIT7;
UCSCTL0 = 0x00;
UCSCTL1 = DCORSEL_6; //DCO产生12MHZ频率
UCSCTL2 = 374; // (374 + 1) * 32768 = 12MHz
UCSCTL3 = SELREF_2;
UCSCTL4 = SELS_3 + SELM_3;
UCSCTL6|=XT2OFF+XT1OFF; // 关闭两个晶振
TA0CTL=0;
TA1CTL=0; //停止定时器
TBCTL=0;
ADC12CTL0=0; //关AD
UCA0CTL1|=UCSWRST; //禁止串口
UCA1CTL1|=UCSWRST;
UCB0CTL1|=UCSWRST;
UCB1CTL1|=UCSWRST;
_EINT();
for(;;)
{
_BIS_SR(LPM3_bits);
_NOP();
}]
我把所有外设均关闭了,想测一下在低功耗状态下的电流,现在功耗是降下来了,但时间太长了 |
|