Watchdog reset problem...

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

I set the watchdog for 2.1 seconds timeout (mega8 @ 14.7 MHz):

 WDTCR = 0x1F;
 WDTCR = 0x0F;

Strange thing... it seems the doggy fires-up for this sequence of code:

  watchdog_reset();
  while(!Timeout) // 1000ms
  {
       // do smthing...
  } 

If I reset the doggy INSIDE the while loop, it works ok... but I would like to keep it BEFORE the while-loop.
Any ideas?
Thx.

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BTW: I'm pretty sure I've read something here on AVRfreaks about some "issues" when changing the WDTCR or something like that... I don't remember very well...
Any precautions have to be taken when changing watchdog timeout or enabling/disabling the doggy?
Anyone knows something about that?

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.