EmbeddedRelated.com
Forums

About WDT in timer mode

Started by Unknown September 29, 2004
I have setup the WDT as watchdog mode.  In this mode however, when the unit
resets because of a wdt, the values in the variables are lost.  Therefore, what
I would like to do is put the wdt in interval timer mode, so that if the code
ever jumps to the interrupt, I can save the current data and reset the mcu.
 
However, I can not seem to clear the counter in interval timer mode, the
resetting ("WDTCTL = WDT_ADLY_250;") does not work in interval mode. 
Any ideas on how to reset the wdt counter in interval timer mode?
 
Regards,
 
Omer YALHI
oyalhi@oyal...
http://www.teksan.com.tr
 





Beginning Microcontrollers with the MSP430

Have you enabled the Watdog timer interrupt in the interrupt enable
register?


-----Ursprgliche Nachricht-----
Von: er Yalhi [mailto:oyalhi@oyal...]
Gesendet am: Mittwoch, 29. September 2004 09:49
An: msp430@msp4...
Betreff: [msp430] About WDT in timer mode


I have setup the WDT as watchdog mode.  In this mode however, when the unit
resets because of a wdt, the values in the variables are lost.  Therefore,
what I would like to do is put the wdt in interval timer mode, so that if
the code ever jumps to the interrupt, I can save the current data and reset
the mcu.
 
However, I can not seem to clear the counter in interval timer mode, the
resetting ("WDTCTL = WDT_ADLY_250;") does not work in interval mode. 
Any
ideas on how to reset the wdt counter in interval timer mode?
 
Regards,
 
Omer YALHI
oyalhi@oyal...
http://www.teksan.com.tr
 







.

 
Yahoo! Groups Links



 



Dear Hauenstein Stefan,
 
I have enabled the interrupt and I am getting the interrupts as expected.
However, this is the question I have actually, I do not want to get
interrupts at all by clearing the counter (just like in watchdog mode).
That way, I get a wdt interrupt without resetting the mcu.
 
Is there any way to clear the watchdog counter, so that I do not get
interrupts in interval timer mode?
 
Regards, Omer

  _____  

From: Hauenstein Stefan [mailto:s.hauenstein@s.ha...] 
Sent: Wednesday, September 29, 2004 12:10 PM
To: 'msp430@'msp...'
Subject: AW: [msp430] About WDT in timer mode


Have you enabled the Watdog timer interrupt in the interrupt enable
register?







Omer,

have you tried WDTCTL |= (WDTPW + WDTCNTCL)? By setting the WDTCNTCL 
bit, the WDT is cleared, according to the datasheet, in the chapter 
about the watchdog.

Regards,
Adriano.

Omer YALHI wrote:
> Dear Hauenstein Stefan,
>  
> I have enabled the interrupt and I am getting the interrupts as expected.
> However, this is the question I have actually, I do not want to get
> interrupts at all by clearing the counter (just like in watchdog mode).
> That way, I get a wdt interrupt without resetting the mcu.
>  
> Is there any way to clear the watchdog counter, so that I do not get
> interrupts in interval timer mode?
>  
> Regards, Omer
> 
>   _____  
> 
> From: Hauenstein Stefan [mailto:s.hauenstein@s.ha...] 
> Sent: Wednesday, September 29, 2004 12:10 PM
> To: 'msp430@'msp...'
> Subject: AW: [msp430] About WDT in timer mode
> 
> 
> Have you enabled the Watdog timer interrupt in the interrupt enable
> register?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 

So you are saying that it is possible to clear the counter and prevent the
interrupt (in interleaved timer mode)?  I could not see this in the
datasheet that is why I am asking and that the following does not work:
 
WDTCTL = (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)
 
for 250ms interval using aclk.
 
Regards, Omer
 
 

  _____  

From: Adriano [mailto:adriano@adri...] 
Sent: Wednesday, September 29, 2004 3:20 PM
To: msp430@msp4...
Subject: Re: [msp430] About WDT in timer mode


Omer,

have you tried WDTCTL |= (WDTPW + WDTCNTCL)? By setting the WDTCNTCL 
bit, the WDT is cleared, according to the datasheet, in the chapter 
about the watchdog.

Regards,
Adriano.






So, you are not refreshing the timer within the interval period. This is
why
you get interrupts.

Regards 
Stefan


-----Ursprgliche Nachricht-----
Von: Omer YALHI [mailto:oyalhi@oyal...]
Gesendet am: Mittwoch, 29. September 2004 14:32
An: msp430@msp4...
Betreff: RE: [msp430] About WDT in timer mode


So you are saying that it is possible to clear the counter and prevent the
interrupt (in interleaved timer mode)?  I could not see this in the
datasheet that is why I am asking and that the following does not work:
 
WDTCTL = (WDTPW+WDTTMSEL+WDTCNTCL+WDTSSEL+WDTIS0)
 
for 250ms interval using aclk.
 
Regards, Omer
 
 

  _____  

From: Adriano [mailto:adriano@adri...] 
Sent: Wednesday, September 29, 2004 3:20 PM
To: msp430@msp4...
Subject: Re: [msp430] About WDT in timer mode


Omer,

have you tried WDTCTL |= (WDTPW + WDTCNTCL)? By setting the WDTCNTCL 
bit, the WDT is cleared, according to the datasheet, in the chapter 
about the watchdog.

Regards,
Adriano.








.

 
Yahoo! Groups Links



 



Stefan hi,
 
In MSP430 the WDT can be used for 2 purposes.  One is for WDT mode, where
the WDT counter needs to be cleared in order "not" to get a PUC.  The
other
function is used as a basic timer, where no PUC occurs, ever.  I use the
second mode, Interval Timer Mode, where there are no PUCs but only
interrupts.  I set it to be 250ms and I reset the WDT before 250ms.  STILL I
get an interrupt.  So I am assuming it is not possible to clear the counter
in Interval Timer Mode.
 
Basically the question is: Is it possible to clear the wdt counter, when wdt
is used in "Interval Timer Mode"?
 
Regards, Omer


  _____  

From: Hauenstein Stefan [mailto:s.hauenstein@s.ha...] 
Sent: Wednesday, September 29, 2004 3:41 PM
To: 'msp430@'msp...'
Subject: AW: [msp430] About WDT in timer mode


So, you are not refreshing the timer within the interval period. This is why
you get interrupts.

Regards 
Stefan






I got your point, Omer. Maybe you don't get an interrupt if you stop the 
  watchdog before resetting it. Have you tried setting the WDTHOLD bit? 
If that doesn't work, you can disable the WDT interrupt before the 
reset, and enable it soon after.

Regards,
Adriano.

Omer YALHI wrote:
> Stefan hi,
>  
> In MSP430 the WDT can be used for 2 purposes.  One is for WDT mode, where
> the WDT counter needs to be cleared in order "not" to get a PUC. 
The other
> function is used as a basic timer, where no PUC occurs, ever.  I use the
> second mode, Interval Timer Mode, where there are no PUCs but only
> interrupts.  I set it to be 250ms and I reset the WDT before 250ms.  STILL
I
> get an interrupt.  So I am assuming it is not possible to clear the counter
> in Interval Timer Mode.
>  
> Basically the question is: Is it possible to clear the wdt counter, when
wdt
> is used in "Interval Timer Mode"?
>  
> Regards, Omer
> 
> 
>   _____  
> 
> From: Hauenstein Stefan [mailto:s.hauenstein@s.ha...] 
> Sent: Wednesday, September 29, 2004 3:41 PM
> To: 'msp430@'msp...'
> Subject: AW: [msp430] About WDT in timer mode
> 
> 
> So, you are not refreshing the timer within the interval period. This is
why
> you get interrupts.
> 
> Regards 
> Stefan
> 
> 
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 

Hmm, I'll try that and let you know.  Maybe, as you said, the wdt
needs to
be disabled first in timer mode.
 
Thanks, Omer
 


  _____  

From: Adriano [mailto:adriano@adri...] 
Sent: Wednesday, September 29, 2004 5:44 PM
To: msp430@msp4...
Subject: Re: [msp430] About WDT in timer mode



I got your point, Omer. Maybe you don't get an interrupt if you stop the 
  watchdog before resetting it. Have you tried setting the WDTHOLD bit? 
If that doesn't work, you can disable the WDT interrupt before the 
reset, and enable it soon after.

Regards,
Adriano.






You're welcome, Omer, and before you re-enable the WDT interrupt, you 
will probably have to disable the WDTIFG flag, I forgot to mention in 
the last post.

Regards,
Adriano.


Omer YALHI wrote:
> Hmm, I'll try that and let you know.  Maybe, as you said, the wdt
needs to
> be disabled first in timer mode.
>  
> Thanks, Omer
>  
> 
> 
>   _____  
> 
> From: Adriano [mailto:adriano@adri...] 
> Sent: Wednesday, September 29, 2004 5:44 PM
> To: msp430@msp4...
> Subject: Re: [msp430] About WDT in timer mode
> 
> 
> 
> I got your point, Omer. Maybe you don't get an interrupt if you stop
the 
>   watchdog before resetting it. Have you tried setting the WDTHOLD bit? 
> If that doesn't work, you can disable the WDT interrupt before the 
> reset, and enable it soon after.
> 
> Regards,
> Adriano.
> 
> 
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
>