This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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
  • I am trying to use watchdog timer as an interval timer
    1) this is a bad idea
    2) every derivative seems to have a different watchdog (if any) you need be more specific.
    3) setting EA in a "device" specific function will usually give you trouble down the road.

    Erik

Reply
  • I am trying to use watchdog timer as an interval timer
    1) this is a bad idea
    2) every derivative seems to have a different watchdog (if any) you need be more specific.
    3) setting EA in a "device" specific function will usually give you trouble down the road.

    Erik

Children
No data