Hi,
Am Working on Watchdog timer in P89V51RD2. But Am not getting the result. My code is
WDTC|=0x18; // Enable OUT and Reset WDTD=count; // Load Count to Reg WDTC|=0x01; // Start WDT On LED1 while(WDTC&0x04); // Wait for Flag On LED2
but its toggling always. Actually i have defined the registers in reg52.h file.
Can anyone suggest me how i can solve this problem.
Thanks in Advance.
Regards, Madev
the purpose of a watchdog is to reset the uC when it is not fed. Thus, when the WD times out it resets the uC.
Erik
My Program worked with small modification
WDTC=0x18; // Enable OUT and Reset WDTD=count; // Load Count to Reg WDTC|=0x02; // Refresh WDT WDTC|=0x01; // Start WDT
WDTC|=0x02; // To Refresh before timeout WDTC&=0xFE; // To Stop WDT
May be helpfull
hi, i am happy my code was help for you.