We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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); }
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