Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
societyofrobots
PostPosted: Jan 11, 2009 - 03:23 PM
Hangaround


Joined: Nov 29, 2007
Posts: 134


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
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
JohanEkdahl
PostPosted: Jan 11, 2009 - 04:19 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 22062
Location: Lund, Sweden

Quote:

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

And you did actually click the Program button after that?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
societyofrobots
PostPosted: Jan 11, 2009 - 04:52 PM
Hangaround


Joined: Nov 29, 2007
Posts: 134


Thanks for your confidence in me Confused

Yeap I clicked the program button. Many times. Razz

_________________
How do YOU make a robot?
http://www.societyofrobots.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Mike B
PostPosted: Jan 11, 2009 - 06:43 PM
Raving lunatic


Joined: Jun 22, 2004
Posts: 3849
Location: South West Utah, USA

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.?
 
 View user's profile Send private message  
Reply with quote Back to top
andrew99
PostPosted: Jan 11, 2009 - 08:52 PM
Resident


Joined: Jan 10, 2007
Posts: 899
Location: Toronto, Ontario, Canada

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


Last edited by andrew99 on Jan 12, 2009 - 12:01 PM; edited 1 time in total
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
JohanEkdahl
PostPosted: Jan 12, 2009 - 12:02 AM
10k+ Postman


Joined: Mar 27, 2002
Posts: 22062
Location: Lund, Sweden

Quote:

Thanks for your confidence in me

Nothing personal. Going on my own experience. See eg http://www.avrfreaks.net/index.php?name ... highlight= Very Happy
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
H. Carl Ott
PostPosted: Jan 12, 2009 - 01:10 AM
Hangaround


Joined: Oct 03, 2001
Posts: 285
Location: NYC, USA

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
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
disjuku
PostPosted: Sep 28, 2013 - 07:50 AM
Rookie


Joined: Jan 09, 2012
Posts: 28
Location: New Zealand

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 <avr/wdt.h> 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.
[/quote]
 
 View user's profile Send private message  
Reply with quote Back to top
joeymorin
PostPosted: Sep 28, 2013 - 08:02 PM
Raving lunatic


Joined: Jul 17, 2012
Posts: 2580
Location: Location, Location

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
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits