My code for watchdogtimer0 is (header file inc/tm4c129encpdt.h is included) -
SYSCTL_RCGCWD_R = 0x1; // enable and provide clock to watchdog timer, system clock which is 120Mhz
WATCHDOG0_LOAD_R = 0xffffffff; // full scale value given to counter gives timout around 35sec
WATCHDOG0_CTL_R = 0x02; // enable the reset
while(1);
When I am running this code, at first the device gets resets just after it executes this line-
WATCHDOG0_CTL_R = 0x02; // enable the reset
And in the second run after reset, it sticks into while(1) loop for sometimes and goes somewhere else. But watchdog is not working.
I am calling this code into some task created by me which has a low priority than other tasks. I am sure the code is executing these lines and then after that the task gets preempted when I enter into while loop.
Is my code write for watchdog timer 0?
Thanks
akhi