Thanks for the tip on the nana lib, could come in useful, but i do have some tried and tested assertion macros that have served me fine,. I wasn't suggesting that the eeprom fix is a good idea for production code, only to find out what is going wrong, you need some area that won't be over written when a reset/error occurs that you can recover. unless you declare some memory as noinit, then run a reset task before the main function runs, read out the values then clear it to a known value. Yes it can wear out fast (Rotating addresses sometimes helps) Its a debug tool only !! As for mapping the wdt to an interrupt, haven't come across any problems yet with it, this way you could use ram as the the scratchpad rather then eeprom, as at least the errors could be trapped outputted here. Regards --- In AVR-Chat@yahoogroups.com, Bob Paddock <bob.paddock@...> wrote: > > On Tue, Jul 21, 2009 at 4:01 AM, > s.holder123@...<s.holder123@...> wrote: > > > > > > Just a minor point, the newer range of AVR devices , (atmega168, xmega etc) > > have the capability of mapping the watchdog timeout to an interrupt rather > > than a reset, > > Check the errata, that doesn't work in some parts. > > A bad recovery can actually be more dangerous that crashed code > if done wrong. > > > 1) The dark art of assertion Macros, these can prove inavluable in > > determining a porblem area of code. > > http://directory.fsf.org/project/nana/ > may be better. > > > > > 2) Just before you "Tickle/Kick" the watchdog include a routine for writing > > a value to an eeprom area a bytye should do it, > > That could wear out a EEPROM block fast. Even if just used in debugging mode. > You should always debug the code you ship. Having debug mode and a ship mode > is not wise. > > > > 1) Build a watchdog task which is the only part of the software that is > > allowed to tickle the watchdog. > > http://www.ganssle.com/watchdogs.pdf > > -- > http://www.softwaresafety.net/ > http://www.wearablesmartsensors.com/ > http://www.designer-iii.com/ > http://www.unusualresearch.com/ >
Message
Re: WatchDog Timer
2009-07-21 by s.holder123@btinternet.com
Attachments
- No local attachments were found for this message.