watch dog timer won't disable in AVR Studio

Last post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using an ATmega640. It worked fine.

Enabled WDT using latest version of AVR Studio b623 using Fuses tab.

My ATmega640 would then reset crazy fast. As expected.

Now I go back to Fuses and remove the check to WDT.

My ATmega640 still resets crazy fast. Despite AVR Studio claiming its off, it won't actually turn WDT off!

(power supply is fine)

Anyone seen this problem or know what I'm doing wrong?

How do YOU make a robot?
http://www.societyofrobots.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Now I go back to Fuses and remove the check to WDT.

And you did actually click the Program button after that?

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your confidence in me :?

Yeap I clicked the program button. Many times. :P

How do YOU make a robot?
http://www.societyofrobots.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you correctly read the AVR signature? If not, the indication of the WDTON fuse state might be wrong.

Did you also erase the chip to remove any program code that might be misbehaving?

Can you high voltage parallel program your AVR to positively clear the WDTON fuse, even if the AVR clock fuses are messed up, etc.?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try to verify that you are actually changing your program on the device. Lengthen the WDT time out and see if the changes the period. Have you changed any other flags?

A

AVR Studio 4 Ver. 4.18 684
avr-gcc Ver. 4.3.0
ISIS 7
ELECTRA

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Thanks for your confidence in me

Nothing personal. Going on my own experience. See eg http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=72242&highlight= :D

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure about this one, but also be sure to power cycle the target (if you have not already). Seem to remember having a similar experience with a mega48. Backup batteries/supercaps can confuse the issue.

-carl

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know this is an old subject, however, I have just encountered the same problem and further information may be of use to others looking for a solution to this.

I enable the watch dog timer using and the function wdt_enable(WDTO_30MS);. When I restart the program, I call wdt_disable();. Watching the IO view I can see that the watchdog timer is NOT actually being disabled, despite the program having been reset through Atmel studio, or reset by cycling the power to the device.

Setting MCUSR to 0x00 (clearing the reset flags), before calling the wdt_disable() function successfully disables the watchdog timer.

Looking into this further, the datasheet for the atmega1280 I am using does explain why:

Quote:
• Bit 3 - WDE: Watchdog System Reset Enable
WDE is overridden by WDRF in MCUSR. This means that WDE is always set when WDRF is
set. To clear WDE, WDRF must be cleared first. This feature ensures multiple resets during conditions
causing failure, and a safe start-up after the failure.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

disjuku wrote:
Looking into this further, the datasheet for the atmega1280 I am using does explain why:
So does looking at the documentation for wdt_disable().

JJ

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience. Experience comes from bad judgement."