| ??? 01/30/03 16:05 Read: times |
#37772 - RE: expanded on above Responding to: ???'s previous message |
#ifndef WATCHDOG_WATCH
#define M_KICK_THE_PUPPY
{
BSP3_REVB_STB_DOG = 0;
BSP3_REVB_STB_DOG = 1;
}
#else // WATCHDOG_WATCH
#define M_KICK_THE_PUPPY
{
wdcnt = 0;
}
#endif // WATCHDOG_WATCH
//////////////////////////////////////////////////
//
// ISR for timer 0 (unused)
//
#ifndef WATCHDOG_WATCH
VOID noISRt0 (VOID) interrupt 1 using 0 // ET0 DEAD
{
} /*- end noISRt0 -*/
#else
VOID ISRt0 (VOID) interrupt 1 using 1 // ET0 for watchdog check
{
SB_TCON_TF0 = 0;
wdcnt++;
if (wdcnt > wdchk)
{
SF_TMOD = 0; // 16 bit counter
SB_IE_ET0 = 0;
SF_TMOD = 1; // 16 bit counter
SB_IE_ET0 = 1;
}
} /*- end noISRt0 -*/
#endif // WATCHDOG_WATCH
WATCHDOG_WATCH will enable the check routine when defined M_KICK_THE_PUPPY is the macro used througout the program to toggle the watchdog. wdcnt is a global uchar wdchk is a global uchar you set to the mumber you need. SF_TMOD = 0; SB_IE_ET0 = 0; SF_TMOD = 1; SB_IE_ET0 = 1; is just there to make a place to set a breakpoint. Have fun, don't let the puppy bite you Erik |
| Topic | Author | Date |
| Code Recovery with Watch Dog Timers | 01/01/70 00:00 | |
RE: expanded on above | 01/01/70 00:00 | |
| RE: Code Recovery with Watch Dog Timers | 01/01/70 00:00 | |
| RE: Code Recovery with Watch Dog Timers | 01/01/70 00:00 | |
| RE: Code Recovery with Watch Dog Timers | 01/01/70 00:00 | |
| RE: Code Recovery with Watch Dog Timers | 01/01/70 00:00 | |
| RE: Code Recovery with Watch Dog Timers | 01/01/70 00:00 |



