| ??? 01/10/02 15:50 Read: times |
#18519 - RE: Refreshing WatchDog in Timer Interru |
Sounds, nobody understand my previous words.
So this example of an universal watchdog routine should explain it. Peter #pragma cd #include<reg51.h> char watch_process1; char watch_process2; char watch_processn; sbit WATCH_DOG = P1^1; void t0_interrupt( void ) interrupt 1 { TH0 = 0xFF & (-50000 >> 8); // 50ms at 12MHz TL0 = 0xFF & -50000; if( --watch_process1 == 0 ) while(1); // time out -> endless loop if( --watch_process2 == 0 ) while(1); if( --watch_processn == 0 ) while(1); WATCH_DOG = ~WATCH_DOG; // only if all routines running succesful ! } process1() { watch_process1 = 21; // e.g. must be executed every 1 sec } process2() { watch_process2 = 201; // e.g. must be executed every 10 sec } |
| Topic | Author | Date |
| Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interru | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog sanjeev | 01/01/70 00:00 | |
| RE: Refreshing ...Erik | 01/01/70 00:00 | |
| RE: Refreshing ...Erik | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog K. Ganeshan | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interrupt | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interru | 01/01/70 00:00 | |
| RE: Refreshing WatchDog in Timer Interru | 01/01/70 00:00 | |
| RE: Refreshing WatchDog Bahri | 01/01/70 00:00 | |
Merhaba..... | 01/01/70 00:00 |



