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

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
Manufacturer:
ATMEL
Quantity:
13 983
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
38
ATtiny13
Watchdog System Reset Flag (WDRF) and the WDE control bit in the initialisation rou-
tine, even if the Watchdog is not in use.
The following code example shows one assembly and one C function for changing the
time-out value of the Watchdog Timer.
Note:
Note: The Watchdog Timer should be reset before any change of the WDP bits, since a
change in the WDP bits can result in a time-out when switching to a shorter time-out
period.
Assembly Code Example
C Code Example
WDT_Prescaler_Change:
void WDT_Prescaler_Change(void)
{
}
; Turn off global interrupt
cli
; Reset Watchdog Timer
wdr
; Start timed sequence
in
ori
out
; --
; Set new prescaler(time-out) value = 64K cycles (~0.5 s)
ldi
out
; --
; Turn on global interrupt
sei
ret
__disable_interrupt();
__watchdog_reset();
/* Start timed sequence */
WDTCR |= (1<<WDCE) | (1<<WDE);
/* Set new prescaler(time-out) value = 64K cycles (~0.5 s) */
WDTCR = (1<<WDE) | (1<<WDP2) | (1<<WDP0);
__enable_interrupt();
1. The example code assumes that the part specific header file is included.
r16, WDTCR
r16, (1<<WDCE) | (1<<WDE)
WDTCR, r16
Got four cycles to set the new values from here -
r16, (1<<WDE) | (1<<WDP2) | (1<<WDP0)
WDTCR, r16
Finished setting new values, used 2 cycles -
(1)
(1)
2535G–AVR–01/07

Related parts for attiny13-20ss