Jump to content
Sign in to follow this  
dave45

Serial does not work when watchdog timer is enabled

Recommended Posts

I'm new to micro-controller programming and am seeking some help. I'm using the MSP-EXP430G2553 Launchpad.

Following examples from online contributors I have inserted the following as the first line of code:

// WDTCTL = WDTPW + WDTHOLD;       // Stop WDT

However, when this is enabled it prevents serial monitoring and interrupts from working.

I don't know if it is relevant but the uart jumpers are set to HW.

Share this post


Link to post
Share on other sites

If  I recall correctly:

 

I do not think you need to do any watchdog setup with Energia.

 

The Energia core sets it up as for use as the timebase for time functions. Any changes you make to the setting outside the Energia envelope will cause issues.

 

See:

 

Share this post


Link to post
Share on other sites
23 hours ago, dave45 said:

// WDTCTL = WDTPW + WDTHOLD;       // Stop WDT

However, when this is enabled it prevents serial monitoring and interrupts from working.

This is "expected behavior." When the watchdog is enabled, it needs to be serviced regularly on a schedule that's far shorter than serial communication. The intent of the watchdog is to restart the device in the event of an unexpected endless loop, or other conditions that result in the mcu hanging.

This reference on Wikipedia will explain it better.

FWIW - it is not at all unusual for makers (or others) to disable the watchdo.

Bob

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...