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
_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to