Author Topic: Why do we stop watchdog timer on MSP430 ?  (Read 3516 times)

0 Members and 1 Guest are viewing this topic.

Offline Nhan95Topic starter

  • Contributor
  • Posts: 34
  • Country: vn
Why do we stop watchdog timer on MSP430 ?
« on: May 14, 2015, 01:41:50 am »
I see that many programs for MSP430 microcontroller, they usually stop the watchdog timer first:
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
What's watchdog timer and why do have to do that ? Does other MCU have watchdog timer :)
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Why do we stop watchdog timer on MSP430 ?
« Reply #1 on: May 14, 2015, 01:46:39 am »
IIRC this has something to do with people not wanting to have the watchdog enabled by default. The damn thing is on by default and set to a very short interval which causes trouble with initialisation code (zeroing the memory and copying initialised variables into RAM).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Why do we stop watchdog timer on MSP430 ?
« Reply #2 on: May 14, 2015, 01:49:34 am »
The purpose of a watchdog timer is to forcibly reset your microcontroller if your code gets stuck for some reason. It has a timeout period, and if you don't poke it during that period, it resets you. You're supposed to stick that poke somewhere in your main loop, preferably with some sanity checks so you only poke it if everything is good.

Yes, most microcontrollers have one, but MSP430 is somewhat unique in that it starts up with it enabled by default.
No longer active here - try the IRC channel if you just can't be without me :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf