Timed Sequences for Changing the Configuration of the Watchdog Timer

The sequence for changing the Watchdog Timer configuration differs slightly between the safety levels. Separate procedures are described for each level.

Assembly Code Example
WDT_off:
 
   ; reset WDT   
   WDR 
   ; Write logical one to WDCE and WDE
   in r16, WDTCR 
   ori r16, (1<<WDCE)|(1<<WDE) 
   out WDTCR, r16 
   ; Turn off WDT 
   ldi r16, (0<<WDE) 
   out WDTCR, r16 
   ret
C Code Example
void WDT_off(void)
{
 
   /* reset WDT */
 
   _WDR(); 
   /* Write logical one to WDCE and WDE */ 
   WDTCR |= (1<<WDCE) | (1<<WDE); 
   /* Turn off WDT */ 
   WDTCR = 0x00;
}