Watchdog Timer as an interval timer

Hi,
I am trying to use watchdog timer as an interval timer. To test that the interval timer generates an interrupt, I am toggling a pin in the ISR of the watchdog interval timer. But it is not working. The control never enters the timer ISR. Can anyone please give the solution to this problem.

Any pointers, suggestions, solution will be appreciated. The following is a part of the source code.


void Watchdog_Timer_Init()
{
WDCON &= 0xC0;
WDCON |= 0x08;
EWD = 1;
EA = 1;
}

static void watchdog_timer_isr(void)interrupt 10 using 0
{
TOG_OUT = ~TOG_OUT; // Toggle output pin
WDCON &= 0xDF; // Clear watchdog timer  overflow flag
}
/*-------------------------------*/
void main()
{
Watchdog_Timer_Init();
while(1);
}

Parents Reply Children
No data
More questions in this forum