avr-chat
[Top][All Lists]
Advanced

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

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


From: Joerg Wunsch
Subject: Re: [avr-chat] known issues with Mega168 and wdt.h?
Date: Tue, 2 May 2006 10:22:34 +0200 (MET DST)

"Steve Franks" <address@hidden> wrote:

> Ah, that's it.  wdt_disable() at the top of main() on the old
> architecture is sufficient.  I guess *reading* wdt.h instead of
> *skimming* wdt.h would be advised.

Or read the documentation produced by it:

http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html

I recommend placing the respective function in section .init3 there.
In many cases, it will probably be sufficient to put it at the
beginning of main(), but I've just been curious, and made a short
estimation.

Say, in an ATmega1281, you might be tempted to put a number of string
literals in RAM as you've got 8 KB of RAM which is sufficient for a
while (i. e. you don't move them explicitly to progmem).  The loop to
initialize the RAM takes 9 clocks per byte, so with the default 1 MHz
CPU clock, that will be 9 µs per byte.  With the watchdog triggering
after 15 ms, you could have up to 1660 bytes of initialized data (20 %
of the RAM) until the watchdog fires if the wdt_disable() is only
placed at the beginning of main().

-- 

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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