Watchdog Timer

/*start short loop to test DWDT*/ for (i = 0; i < 4000; i ++) {//idle delay

j = (i *13) % 4000;

}

//Disable watchdog timer before timer expires WDTIMER = 0x40;

WDTIMER &= ~0x40;

//Reinitialize watchdog, sinice it has just been disabled init_watchdog ( );

/*start short loop to test RWDT*/ for (i = 0; i < 400; i ++) {//idle delay

j = (i *13) % 4000;

}

/*Reset Watchdog Timer before Watchdog Timer Expires*/ WDTIMER = 0x20;

WDTIMER &= ~0x20;

/*Infinite loop to test Watchdog Timer Time out with interrupt. In the case in which the Watchdog Reset cannot be disabled, there will not be any interrupts. The watchdog time would eventually run out, and a reset procedure will be activated*/ while (1)

{

watchdog_loop = 1; while (watchdog_loop);

}

}

Keil Simulator

17-15

 

Page 243
Image 243
Texas Instruments MSC1210 manual Keil Simulator 17-15