Watchdog Timer:-
-----------------------
-is a countdown timer used to reset the microcontroller after a specific timeout. The microcontroller should kick the Watchdog timer by resetting its value preventing it from reaching Zero.
- One should adjust the watchdog timer to guarantee that a specific code will be executed is a specific time period less than the watchdog period. At the end of that piece of code, one should disable the watchdog timer or reload it with a new value.
*To measure the execution time of a specific function we can use the oscilloscope to determine its switching time (context switch and context restore) by setting a pin high before calling it and clearing it again after returning to main function (That method is the most accurate method as it takes in consideration the Hardware delay and experience the real world/HW.)
Watchdog Conditions:
-----------------------------
1- Has a separate clock (Works on its own clock)
2- Has disable Sequence.
NOTE:-
-------------
We need to keep the Watchdog sleep by refilling it with a new value and preventing it from reaching Zero, hence preventing the microcontroller form resetting.
Watchdog in AVR (ATmega32):-
-------------------------------------------
Test Code:
-----------------
https://github.com/AmrHRAbdeen/ATmega32_Projects/tree/master/WatchDogTimer
-----------------------
-is a countdown timer used to reset the microcontroller after a specific timeout. The microcontroller should kick the Watchdog timer by resetting its value preventing it from reaching Zero.
- One should adjust the watchdog timer to guarantee that a specific code will be executed is a specific time period less than the watchdog period. At the end of that piece of code, one should disable the watchdog timer or reload it with a new value.
*To measure the execution time of a specific function we can use the oscilloscope to determine its switching time (context switch and context restore) by setting a pin high before calling it and clearing it again after returning to main function (That method is the most accurate method as it takes in consideration the Hardware delay and experience the real world/HW.)
Watchdog Conditions:
-----------------------------
1- Has a separate clock (Works on its own clock)
2- Has disable Sequence.
NOTE:-
-------------
We need to keep the Watchdog sleep by refilling it with a new value and preventing it from reaching Zero, hence preventing the microcontroller form resetting.
Watchdog in AVR (ATmega32):-
-------------------------------------------
Test Code:
-----------------
https://github.com/AmrHRAbdeen/ATmega32_Projects/tree/master/WatchDogTimer
0 comments:
Post a Comment