Electronic – How to use watchdog timer in ATmega128

atmegaavrtimerwatchdog

I am working with an ATmega128 and need to reset the microcontroller after some 10 seconds has passed and the user has not interacted with microcontroller. As an example when the user has not pressed any key from a keypad for 10 seconds the controller should get reset.

A watchdog timer is available in the ATmega128 but I am able to get a maximum of 2 seconds delay before it resets. But I require 10 seconds.

Maybe I can do it using timers but I don't know how to proceed?

Best Answer

Instead of using Watchdog timer for this purpose,

Start a timer before accepting inputs from User, Reset that timer everytime user enters something... If user is inactive for given time, Timer will overflow... Set flag in timer and if that flag is set, break out from your "Accept Input" Loop!