avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-chat] known issues with Mega168 and wdt.h?


From: Steve Franks
Subject: [avr-chat] known issues with Mega168 and wdt.h?
Date: Sun, 30 Apr 2006 09:23:20 -0700

Hi all.
 
Can you tell I'm on a new design.  Getting tired of my gabbing yet ;) ?
 
So,  I was somewhat vexed by adding wdt_enable(TO_2S) at the end of my main function, followed by a sleep, and adding wdt_disable() at the top of main().
 
Two issues:
 
1) The uC would reset, say, every 125mS, not every 2s.
 
2) The wdt was never getting disabled, as the program would restart in the middle of the first puts().
 
The fix:
 
Replacing wdt_disable() and wdt_enable() with the register writes from the Mega168 user manual made it work exactly as expected; 2s resets, and disabled until I explicitly re-enable it.
 
I see #ifdef Maga168 in the wdt.h file, so I would assume support is nominally there - any way I could have confused it? 
 
This is non-issue for me at this point, but with the robustness I've come to expect from WinAvr, I am suprized at this, and thought I'd bring it up.
 
Best,
Steve

reply via email to

[Prev in Thread] Current Thread [Next in Thread]