attiny13-20ss ATMEL Corporation, attiny13-20ss Datasheet - Page 37

no-image

attiny13-20ss

Manufacturer Part Number
attiny13-20ss
Description
8-bit Microcontroller With 1k Bytes In-system Programmable Flash - Atmel Corporation
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
attiny13-20ssI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
attiny13-20ssJ
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
attiny13-20ssU
Quantity:
2 180
Company:
Part Number:
attiny13-20ssU
Quantity:
100
Company:
Part Number:
attiny13-20ssU
Quantity:
739
Part Number:
attiny13-20ssU-SL383
Manufacturer:
ATMEL
Quantity:
4 132
2535G–AVR–01/07
The following code example shows one assembly and one C function for turning off the
Watchdog Timer. The example assumes that interrupts are controlled (e.g. by disabling
interrupts globally) so that no interrupts will occur during the execution of these
functions.
Note:
Note: If the Watchdog is accidentally enabled, for example by a runaway pointer or
brown-out condition, the device will be reset and the Watchdog Timer will stay enabled.
If the code is not set up to handle the Watchdog, this might lead to an eternal loop of
time-out resets. To avoid this situation, the application software should always clear the
Assembly Code Example
C Code Example
WDT_off:
void WDT_off(void)
{
*/
}
; Turn off global interrupt
cli
; Reset Watchdog Timer
wdr
; Clear WDRF in MCUSR
in
andi
out
; Write logical one to WDCE and WDE
; Keep old prescaler setting to prevent unintentional time-out
in
ori
out
; Turn off WDT
ldi
out
; Turn on global interrupt
sei
ret
__disable_interrupt();
__watchdog_reset();
/* Clear WDRF in MCUSR */
MCUSR &= ~(1<<WDRF);
/* Write logical one to WDCE and WDE */
/* Keep old prescaler setting to prevent unintentional time-out
WDTCR |= (1<<WDCE) | (1<<WDE);
/* Turn off WDT */
WDTCR = 0x00;
__enable_interrupt();
1. The example code assumes that the part specific header file is included.
r16, MCUSR
r16, (0xff & (0<<WDRF))
MCUSR, r16
r16, WDTCR
r16, (1<<WDCE) | (1<<WDE)
WDTCR, r16
r16, (0<<WDE)
WDTCR, r16
(1)
(1)
37

Related parts for attiny13-20ss