Is watchdog timeout reset all the registers in AVR?

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

hehe, i think for you guys, this question seems too simple to be answered, but I never use watchdog timer before, and I saw the datasheet of mga1281 said it will reset all the 'I/O registers', but then I'm wondering if the 'I/O registers' here means all the register in the register summary list.

So is it?

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

If the watchdog timeout results in a reset (some newer AVRs allow you to specify custom ISR code instead) then all the registers are reset. The only difference between a watchdog reset and a normal reset in that in the former special bits are set inside one of the status registers to indicate that the watchdog was the source of the reset.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

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

ok, thanks.

Then I have another question.

Cos I gonna use this WDR inside my bootloader to reset all the register before it jump to the application code. But the problem is for those newer AVRs (mega1281 in my case), I have to put wdt_disable() in the bigining of all the application code to disable the watchdog timer. And this means if I forgot this, the application code will not be executed and it will never be able to jump back to its bootloader (a special RF command to let it jump to bootloader).

So is there any way to avoid this?

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

> So is there any way to avoid this?

Program the BOOTRST fuse, and let the bootloader code handle the jump
to address 0 if no boot loading is desired. This could be handled by
some strapping, so e.g. if a jumper is installed or a button pressed,
it will continue with the bootloader, but otherwise it will always
immediately jump to address 0. When jumping to the bootloader from
the application (by a command), you use an alternate entry point into
the bootloader that bypasses the hardware strapping test.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.