看看门狗这个模块时,对它在LPM4能否运行很疑惑,搜索一下很多人说不行,在但官方例子里有一个文件,说明了看门狗的这个问题,所以分享下
//******************************************************************************
// MSP430G2xx3 Demo - WDT+ Failsafe Clock, DCO SMCLK
//
// Description; Allow WDT+ in watchdog to timeout. Toggle P1.0 in main
// funnction. LPM4 is entered, this example will demonstrate WDT+ feature
// of preventing WDT+ clock to be disabled.
// The WDT+ will not allow active WDT+ clock to be disabled by software, the
// LED continues to Flash because the WDT times out normally even though
// software has attempted to disable WDT+ clock source.
// The MSP430F1xx will stop code execution when software disables WDT+ clock
// source.
// ACLK = n/a, MCLK = SMCLK = default DCO
//
// MSP430G2xx3
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// | P1.0|-->LED
//
// D. Dang
// Texas Instruments Inc.
// December 2010
// Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
//******************************************************************************
#include
void main(void)
{
P1DIR |= 0x01; // Set P1.0 to output
P1OUT ^= 0x01; // Toggle P1.0
_BIS_SR(LPM4_bits); // Stop all clocks
}
sjwh,
对于WDT模块用作看门狗时,关于它的时钟提供是有保护模式的,当进入LPMx时,当其选择的时钟源失效时,会自动切换到VLO上,进而保证看门狗一直运行。当把WDT用作定时器时,此机制是没有的。原文如下:
If SMCLK or ACLK fails as the WDT_A clock source, VLOCLK is automatically selected as the WDT_A
clock source.
When the WDT_A module is used in interval timer mode, there is no fail-safe feature within WDT_A for
the clock source.
以上就是为什么在LPM4模式下,看门狗还工作的原因。
详情回复
发表于 2013-5-28 17:18
If SMCLK or ACLK fails as the WDT_A clock source, VLOCLK is automatically selected as the WDT_A
clock source.
When the WDT_A module is used in interval timer mode, there is no fail-safe feature within WDT_A for
the clock source.