单板状况:
MSP4306989一个、复位电路(RC复位:100千欧,0.1uf)、3.0供电;单板上在无其他器件;
1)使用ti提供的低功耗测试程序:msp430fr69xx_lpm3_02.c,ACLK 使用vlo:10KHz,MCLK 1MHz、SMCLK 1MHz;LPM3;
2)烧进单板功耗为8.24mA,使用fluke万用表测得,无法降低功耗;功耗应该为在2uA左右吧;为何会有8mA的电流也搞不清楚原因了。
3)测试程序也比较简单如下所示:
4)参考文章:http://www.deyisupport.com/question_answer/w/faq/467.msp430.aspx,
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW | WDTTMSEL | WDTSSEL_2 | WDTIS_5; // VLOCLK, ~1s interrupts
SFRIE1 |= WDTIE; // Enable WDT interrupt
// Configure GPIO
P1OUT = 0;
P1DIR = 0xFF;
P2OUT = 0;
P2DIR = 0xFF;
P3OUT = 0;
P3DIR = 0xFF;
P4OUT = 0;
P4DIR = 0xFF;
P5OUT = 0;
P5DIR = 0xFF;
P6OUT = 0;
P6DIR = 0xFF;
P7OUT = 0;
P7DIR = 0xFF;
P8OUT = 0;
P8DIR = 0xFF;
P9OUT = 0;
P9DIR = 0xFF;
P10OUT = 0;
P10DIR = 0xFF;
PJOUT = 0;
PJDIR = 0xFFFF;
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
// Clock System Setup
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
CSCTL1 = DCOFSEL_0; // Set DCO to 1 MHz
CSCTL2 = SELM__DCOCLK | SELS__DCOCLK | SELA__VLOCLK;
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1
CSCTL4 = LFXTOFF | HFXTOFF;
CSCTL0_H = 0; // Lock CS registers
P1DIR |= BIT0; // Turn on LED
__bis_SR_register(LPM3_bits | GIE);
__no_operation(); // For debugger
}
// Watchdog Timer interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=WDT_VECTOR
__interrupt void WDT_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(WDT_VECTOR))) WDT_ISR (void)
#else
#error Compiler not supported!
#endif
{
P1OUT ^= BIT0; // Toggle P1.0 (LED)
}
changgang gao:
实际中把 LED灯的控制关闭了;看门狗延迟16秒左右;
user4132520:
回复 changgang gao:
不用的io设置成输出低电平了吧,把看门狗关上呢,我都是把关门口关掉测试的,不知道会不会是这个问题
灰小子:
回复 Ling Zhu2:
向楼上学习,我昨天看着楼主的代码想了很久,唯独没想到仿真器的问题
changgang gao:
回复 灰小子:
不是仿真器的问题,AD管脚2、6通道设置成AD模式,电流降几百微安
changgang gao:
回复 Ling Zhu2:
今天发现一个新问题,MCU供电3V0,IO脚作为输入时,内部上拉使能,无法达到3V0,在2V8左右,连接到另外一个器件的某一输出脚(输出3V0)这样存在压差,差生漏电现象,额外耗电约为50uA;